[ZODB-Dev] ZEO client hangs when combined with other asyncore code

zodb at bootsch.demon.nl zodb at bootsch.demon.nl
Tue Jun 21 16:18:57 EDT 2005

Hi All,

A combined reply ...

[Stephen Masterman]
>Anyway, your problem may have nothing to do with the details of your
>application if something like this is happening, so you should verify
>that you can successfully connect at all.

Good advice, and yes, we did confirm the connection upfront in a simple unittest,
we test the connection, storing and retrieving from the ZODB with ZEO client/server.
The client and server run on different machines. (XP and linux respectively)

[Dieter Maurer]
> > As long as you ensure that the "asyncore" mainloop is running, there
>> should not be a problem to have more "asyncore" clients.
>> If you happen to run your application on Linux (and use the "GDB"), I
>> can provide detailed instructions on how to find out where your code
>> hangs...
>That would be helpful!

As said above, the client runs on Windows XP, the server on Linux (debian).

[Tim Peters]
>asyncore gives me a headache.

Same here

>  I wonder whether this could be the problem:
>Paul said he's calling ZEO "from within the proxy code", but it sounds like
>the proxy code itself runs "as a side effect" of asyncore callbacks.  If the
>flow is like this:
>   asyncore mainloop invokes POP3 proxy code
>       POP3 proxy code makes a synchronous ZEO call

I think that's exactly how the Proxy runs, we use asynchat and the 'line_terminator'
to trigger a callback, so it appears the code runs 'magically' at first glance.

>then I figure the app may well hang then:  the thread running the asyncore
>mainloop is still running a POP3 proxy callback, waiting for a response that
>can never happen until the asyncore mainloop gets control back (in order to
>send & receive ZEO messages).
>IOW, if Paul added print statements to ZODB's ZEO/zrpc/smac.py's
>SizedMessageAsyncConnection readable() and writable() methods, I bet they
>never trigger when the app appears to be hung (which would mean that the
>thread running asyncore's mainloop is in fact not getting a chance to run
>the asyncore loop anymore).

You're right - I added the suggested comments as first line in the readable() and writable() methods
they never appear.

Could I do synchronous calls to the ZEO server?
An other option to bypass the problem is to use Zope/XMLRPC to do what we want,
I assume that will not suffer they same problem.

Your opinion would be much appreciated,


Vriendelijke groet,
Vriendelijke groet,

More information about the ZODB-Dev mailing list