[Zope] Re: [Warning] Zope/ZEO clients: subprocesses can lead to non-deterministic message loss

Dieter Maurer dieter at handshake.de
Sun Jun 27 14:27:03 EDT 2004


ATTENTION: Crosspost -- Reply-To set to 'zope-dev at zope.org'

On Friday, I reported a bug that can cause non-deterministic message loss
and duplication of messages in forking applications
with an "asyncore" mainloop thread.

Unfortunately, the proposed workararound does not work for
various reasons (as you may already have recognized and reported):

 *  it modifies global variables without protection
    which is a receipe for desaster in a multi-threaded
    environment

 *  it resets state that is already activated.
    Therefore, it is not effective in preventing the main
    problem.

 *  when applied for "system", it blocks Zope
    until the the call returns which may be far too long.


I am working at another work around.
The main ideas is:

  *  Inform "asyncore" about the actor for which its mainloop
     should execute.

  *  When the actor is set, "asyncore" calls handlers only for
     this actor and does nothing otherwise.

The problem: what is an "actor"?

   The most natural choice would
   be the process, identified via its process id. However,
   under Linux, the process id may not identify the process but
   the thread. I am still looking for an adequate, platform
   independent "actor" definition.

-- 
Dieter


More information about the Zope mailing list