MInRk noted that:

    You cannot continue to use zmq sockets after a fork - you have to take care 
in your application that no sockets created before the fork will be [not be] 
used by any calls in the child process.​

Thanks, that makes sense.  But can anyone provide guidance in how to do that?  
I'm quite new to zmq, but somewhat versed in Python multiprocessing.  I think 
there's only one zmq context in use by the main server, and in the child 
process I context.term() as soon as I can.  That did  not fix the issue (but 
then I don't know that it should).

It's entirely possible that there are zmq messages in flight while the 
multiprocessing fork is going on, so I can imagine that when a child 'wakes up' 
it might think it should process a message that it shouldn't.  Is it possible 
to 'suspend' zmq while the fork is occurring so I can somehow have the child 
cleanup things it shouldn't be using, and then the parent resumes zmq 
processing?  Or is there some way to mark the sockets such that they aren't 
inherited by the child?  Or something else I can try?
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to