[CalendarServer-changes] [6876] CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/ adbapi2.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Feb 3 15:42:00 PST 2011
Revision: 6876
http://trac.macosforge.org/projects/calendarserver/changeset/6876
Author: glyph at apple.com
Date: 2011-02-03 15:42:00 -0800 (Thu, 03 Feb 2011)
Log Message:
-----------
fix for test; count all connected connections, not just busy connections
Modified Paths:
--------------
CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/adbapi2.py
Modified: CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/adbapi2.py
===================================================================
--- CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/adbapi2.py 2011-02-03 23:41:57 UTC (rev 6875)
+++ CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/adbapi2.py 2011-02-03 23:42:00 UTC (rev 6876)
@@ -505,11 +505,18 @@
self._waiting.append(txn)
# FIXME/TESTME: should be len(self._busy) + len(self._finishing)
# (free doesn't need to be considered, as it's tested above)
- if len(self._busy) < self.maxConnections:
+ if self._activeConnectionCount() < self.maxConnections:
self._startOneMore()
return txn
+ def _activeConnectionCount(self):
+ """
+ @return: the number of active outgoing connections to the database.
+ """
+ return len(self._busy) + len(self._finishing)
+
+
def _startOneMore(self):
"""
Start one more _ConnectedTxn.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110203/f8e01aec/attachment.html>
More information about the calendarserver-changes
mailing list