[ZODB-Dev] ZEO non-communication problem

Jeremy Hylton jeremy at zope.com
Thu Sep 11 11:43:56 EDT 2003


On Thu, 2003-09-11 at 10:30, Chris Withers wrote:
> Jeremy Hylton wrote:
> > 
> > I think there have been problems in the past with interactions between
> > Python's import lock and dbtab.  
> 
> I had a Google but couldn't find anything, have you got any links to 
> descriptions of this?

I don't remember specifically and can't find it in my email.  My vague
recollection is that it has to do with the zrpc connect thread that ZEO
sometimes starts when ClientStorage is created.  If that thread imports
something that is currently on the import stack of the main thread, it
can cause a deadlock.  If you get lucky and connect quickly, ZEO won't
create a separate thread and you won't deadlock.

> > You always run the top-level module or
> > package __init__ code on import. 
> 
> I'm not sure what you mean by this...

I meant something very obvious, but apparently didn't say it that way. 
If you import module X, all the top-level code in module X is executed. 
So if has the line "print 42" at the top level, importing X will print
42.  Simple, right?

Jeremy





More information about the ZODB-Dev mailing list