[Zodb-checkins] SVN: ZODB/trunk/src/ZEO/zrpc/smac.py fix for
https://bugs.launchpad.net/zodb/+bug/182833 (Severe ZEO
protocol error)
Dieter Maurer
dieter at handshake.de
Thu May 22 04:08:23 EDT 2008
Log message for revision 86902:
fix for https://bugs.launchpad.net/zodb/+bug/182833 (Severe ZEO protocol error)
Notes:
I had to exclude 'kill_does_not_cause_cache_corruption (ZEO.tests.test_cache.__test__)' from the test as it deterministically hung on my platform (with or without my fix)
Running the remaining test suite caused Ran 3279 tests with 5 failures and 0 errors in 17 minutes 31.116 seconds and one import problem -- all failures and problems in zope.testing-3.5.1-py2.4.egg, i.e. unrelated to my fix:
Tests with failures:
/home/dieter/ZopeSVN/W/ZODB/eggs/zope.testing-3.5.1-py2.4.egg/zope/testing/testrunner-coverage.txt
/home/dieter/ZopeSVN/W/ZODB/eggs/zope.testing-3.5.1-py2.4.egg/zope/testing/testrunner-debugging.txt
/home/dieter/ZopeSVN/W/ZODB/eggs/zope.testing-3.5.1-py2.4.egg/zope/testing/testrunner-edge-cases.txt
/home/dieter/ZopeSVN/W/ZODB/eggs/zope.testing-3.5.1-py2.4.egg/zope/testing/testrunner-layers-ntd.txt
/home/dieter/ZopeSVN/W/ZODB/eggs/zope.testing-3.5.1-py2.4.egg/zope/testing/testrunner-colors.txt
Test-modules with import problems:
zope.testing.testrunner.tests
Changed:
U ZODB/trunk/src/ZEO/zrpc/smac.py
-=-
Modified: ZODB/trunk/src/ZEO/zrpc/smac.py
===================================================================
--- ZODB/trunk/src/ZEO/zrpc/smac.py 2008-05-21 22:49:29 UTC (rev 86901)
+++ ZODB/trunk/src/ZEO/zrpc/smac.py 2008-05-22 08:08:22 UTC (rev 86902)
@@ -298,11 +298,17 @@
i += 1
# It is very unlikely that i will be 1.
v = "".join(output[:i])
+ # Note: "output" usually contains the output not yet sent
+ # The "del" below breaks this invariant temporarily.
+ # We must ensure its satisfaction again when we leave the loop
del output[:i]
try:
n = self.send(v)
except socket.error, err:
+ # Fix for https://bugs.launchpad.net/zodb/+bug/182833
+ # ensure the above mentioned "output" invariant
+ output.insert(0, v)
if err[0] in expected_socket_write_errors:
break # we couldn't write anything
raise
More information about the Zodb-checkins
mailing list