[ZCM] [ZC] 1484/ 1 Request "zrpc smac handle_read issue."

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Tue Aug 31 21:37:06 EDT 2004


Issue #1484 Update (Request) "zrpc smac handle_read issue."
 Status Pending, Database/bug medium
To followup, visit:
  http://collector.zope.org/Zope/1484

==============================================================
= Request - Entry #1 by Anonymous User on Aug 31, 2004 9:37 pm

I've been extending ZEO to allow RPC calls on ZEO objects.  In the process I've had to work around what I would consider to be a bug in zrpc.  In the zrpc.smac.SizedMessageAsyncConnection.handle_read there is a lock, around the call to message_input() which is where the processing of zrpc call takes place.

This operation of this lock is described as follows:
# XXX We call message_input() with __input_lock
# held!!!  And message_input() may end up calling
# message_output(), which has its own lock.  But
# message_output() cannot call message_input(), so
# the locking order is always consistent, which
# prevents deadlock.  Also, message_input() may
# take a long time, because it can cause an
# incoming call to be handled.  During all this
# time, the __input_lock is held.  That's a good
# thing, because it serializes incoming calls.

Unfortunately, an effect of the serialisation that it will then block all calls back into the connection.  If an rpc call happens to call back to the otherside of the connection then a lockup will occur because the first handle_read still holds the lock when a second handle_read call is initiated for the reply for the call to the otherside.

Right, I hope that makes sense.

==============================================================



More information about the Zope-Collector-Monitor mailing list