On Jul 1, 2009, at 1:08 PM, Pedro Ferreira wrote:

> Hello,
>
> We have a script that does something like this:
>
> import os
> from ZEO.ClientStorage import ClientStorage
>
> if os.fork()==0:
>    print ClientStorage(('localhost',9675))
>    print 'foo'
> else:
>    print 'child: %s' % os.getpid()
>
> And it worked with ZODB 3.4, but we recently noticed that with 3.8 the
> child process hangs. But if we import ClientStorage only inside the
> process, it seems to work OK.
> Is this supposed to happen?

I'm not interested in trying to support carrying threads across forks.

I could fix this, but it would be a wildly low priority for me.

> Is there a workaround?


Yes, import ClientStorage after the fork.

BTW, your example script gets the child and parent backwards.

Jim

--
Jim Fulton
Zope Corporation


_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to