[CalendarServer-changes] [6083] CalendarServer/trunk/txdav/datastore/subpostgres.py
source_changes at macosforge.org
source_changes at macosforge.org
Mon Aug 16 10:43:52 PDT 2010
Revision: 6083
http://trac.macosforge.org/projects/calendarserver/changeset/6083
Author: glyph at apple.com
Date: 2010-08-16 10:43:52 -0700 (Mon, 16 Aug 2010)
Log Message:
-----------
increase timeout, since 2s is an overly optimistic value
Modified Paths:
--------------
CalendarServer/trunk/txdav/datastore/subpostgres.py
Modified: CalendarServer/trunk/txdav/datastore/subpostgres.py
===================================================================
--- CalendarServer/trunk/txdav/datastore/subpostgres.py 2010-08-16 16:35:52 UTC (rev 6082)
+++ CalendarServer/trunk/txdav/datastore/subpostgres.py 2010-08-16 17:43:52 UTC (rev 6083)
@@ -24,14 +24,13 @@
from twisted.python.procutils import which
from twisted.internet.protocol import ProcessProtocol
-from twisted.internet.error import ProcessDone
+
from twisted.python.reflect import namedAny
from twisted.python import log
from twext.python.filepath import CachingFilePath
pgdb = namedAny("pgdb")
-from pg import DatabaseError
from twisted.protocols.basic import LineReceiver
from twisted.internet import reactor
@@ -284,14 +283,14 @@
# vulnerable to certain types of SQL injection.
c.execute("set standard_conforming_strings=on")
- # Abort any second that takes more than 2 seconds (2000ms) to execute.
- # This is necessary as a temporary workaround since it's hypothetically
- # possible that different database operations could block each other,
- # while executing SQL in the same process (in the same thread, since
- # SQL executes in the main thread now). It's preferable to see some
- # exceptions while we're in this state than to have the entire worker
- # process hang.
- c.execute("set statement_timeout=2000")
+ # Abort any second that takes more than 30 seconds (30000ms) to
+ # execute. This is necessary as a temporary workaround since it's
+ # hypothetically possible that different database operations could
+ # block each other, while executing SQL in the same process (in the
+ # same thread, since SQL executes in the main thread now). It's
+ # preferable to see some exceptions while we're in this state than to
+ # have the entire worker process hang.
+ c.execute("set statement_timeout=30000")
w.commit()
c.close()
return w
@@ -312,7 +311,7 @@
createDatabaseCursor.execute(
"drop database %s" % (self.databaseName)
)
- except DatabaseError:
+ except pgdb.DatabaseError:
pass
try:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100816/56ea1c37/attachment-0001.html>
More information about the calendarserver-changes
mailing list