[Zodb-checkins] CVS: ZODB3 - NEWS.txt:18.104.22.168
tim.one at comcast.net
Fri Feb 4 14:50:43 EST 2005
Update of /cvs-repository/ZODB3
In directory cvs.zope.org:/tmp/cvs-serv17443
Fixed several thread and asyncore races in ZEO's connection dance.
The pollUp() and pollDown() methods were pure busy loops whenever
the asyncore socket map was empty, and at least on some flavors of
Linux that starved the other thread(s) trying to do real work.
This grossly increased the time needed to run tests using these, and
sometimes caused bogus "timed out" test failures.
Renamed class ManagedConnection to ManagedClientConnection, for clarity.
Moved the comment block about protocol negotiation from the guts of
ManagedClientConnection to before the Connection base class -- the
Connection constructor can't be understood without this context. Added
more words about the delicate protocol negotiation dance.
Connection class: made this an abstract base clase. Derived classes
_must_ implement the handshake() method. There was really nothing in
common between server and client wrt what handshake() needs to do, and
it was confusing for one of them to use the base class handshake() while
the other replaced handshake() completely.
Connection.__init__: It isn't safe to register with asyncore's socket
map before special-casing for the first (protocol handshake) message is
set up. Repaired that. Also removed the pointless "optionalness" of
the optional arguments.
ManagedClientConnection.__init__: Added machinery to set up correct
(thread-safe) message queueing. There was an unrepairable hole before,
in the transition between "I'm queueing msgs waiting for the server
handshake" and "I'm done queueing messages": it was impossible to know
whether any calls to the client's "queue a message" method were in
progress (in other threads), so impossible to make the transition safely
in all cases. The client had to grow its own message_output() method,
with a mutex protecting the transition from thread races.
Changed zrpc-conn log messages to include "(S)" for server-side or
"(C)" for client-side. This is especially helpful for figuring out
logs produced while running the test suite (the server and client
log messages end up in the same file then).
=== ZODB3/NEWS.txt 22.214.171.124 => 126.96.36.199 ===
--- ZODB3/NEWS.txt:188.8.131.52 Thu Jan 20 12:06:40 2005
+++ ZODB3/NEWS.txt Fri Feb 4 14:50:13 2005
@@ -2,10 +2,36 @@
Release date: DD-MMM-2005
+Repaired subtle race conditions in establishing ZEO connections, both client-
+and server-side. These account for intermittent cases where ZEO failed
+to make a connection (or reconnection), accompanied by a log message showing
+an error caught in ``asyncore`` and having a traceback ending with:
+ ``UnpicklingError: invalid load key, 'Z'.``
+ ``ZRPCError: bad handshake '(K\x00K\x00U\x0fgetAuthProtocol)t.'``
+ ``error: (9, 'Bad file descriptor')``
+or an ``AttributeError``.
+These were exacerbated when running the test suite, because of an unintended
+busy loop in the test scaffolding, which could starve the thread trying to
+make a connection. The ZEO reconnection tests may run much faster now,
+depending on platform, and should suffer far fewer (if any) intermittent
+"timed out waiting for storage to connect" failures.
-Collector #1676: zodb.pdf in the release tarball was damaged (truncated),
+Collector #1676: ``zodb.pdf`` in the release tarball was damaged (truncated),
because CVS mistakenly believed it was a text file.
More information about the Zodb-checkins