Commit e670f33c authored by Jeremy Hylton's avatar Jeremy Hylton

Fix checkReconnection().

If an exception is raised, make sure the current transaction is
aborted.  And catch more of the oddball exceptions that can get raised
when a server disconnects -- like thread.error.
parent 7afee691
...@@ -12,6 +12,7 @@ import unittest ...@@ -12,6 +12,7 @@ import unittest
import ZEO.ClientStorage, ZEO.StorageServer import ZEO.ClientStorage, ZEO.StorageServer
import ThreadedAsync, ZEO.trigger import ThreadedAsync, ZEO.trigger
from ZODB.FileStorage import FileStorage from ZODB.FileStorage import FileStorage
import thread
from ZEO.tests import forker, Cache from ZEO.tests import forker, Cache
from ZEO.smac import Disconnected from ZEO.smac import Disconnected
...@@ -277,7 +278,8 @@ class ConnectionTests(ZEOTestBase): ...@@ -277,7 +278,8 @@ class ConnectionTests(ZEOTestBase):
while 1: while 1:
try: try:
revid1 = self._dostore(oid, data=obj) revid1 = self._dostore(oid, data=obj)
except ClientDisconnected: except (ClientDisconnected, thread.error), err:
get_transaction().abort()
time.sleep(0.1) time.sleep(0.1)
else: else:
break break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment