[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zodb-dev
Subject:    Re: [ZODB-Dev] ZEO and fork()
From:       Jim Fulton <jim () zope ! com>
Date:       2009-07-02 13:45:58
Message-ID: 8A1122BB-65D8-4341-AB03-4BDF9B84A223 () zope ! com
[Download RAW message or body]


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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic