[zeromq-dev] python-zeromq can't work with fork?

张沈鹏 zsp007 at gmail.com
Tue May 19 09:54:13 CEST 2009


the flup is a famous  python package

http://trac.saddi.com/flup

and the fcgi_fork is one of its server method

you find and source here

http://trac.saddi.com/flup/browser/flup/server/fcgi_fork.py
http://trac.saddi.com/flup/browser/flup/server/preforkserver.py
....

272 	        setCloseOnExec(parent)
273 	        child.setblocking(0)
274 	        setCloseOnExec(child)
275 	        try:
276 	            pid = os.fork()
277 	        except OSError, e:
278 	            if e[0] in (errno.EAGAIN, errno.ENOMEM):
279 	                return False # Can't fork anymore.
280 	            raise
281 	        if not pid:
282 	            # Child
283 	            child.close()
284 	            # Put child into its own process group.
285 	            pid = os.getpid()

...


my problem is

when my web app work together with the fork method

then send the message

the zmq_server seem can't receive the message

when use the single process method

everything is right



More information about the zeromq-dev mailing list