[zeromq-dev] multiprocessing forked children kill zeromq server

Matt Connolly matt.connolly at me.com
Sat Aug 31 00:12:30 CEST 2013


I've been looking at a similar scenario using ruby.

As far as I can tell you cannot even touch anything relating to the parents context in the child, including closing it. I haven't fully tested it out but it looks to me like the pipes used for internal communication in the context will cause messages within he context to go to the wrong place causing asserts in both child and parent. 

I'm experimenting with a way of terminating the inherited context in the child process (closing all sockets and pipes and terminating all zmq threads) but haven't managed to do it with out triggering an assert somewhere. 

The only thought I had was to use a parent with no zmq context and only create a context in a child so that there is never any inherited resources. This may not easily fit your use case though. 

Best,
Matt

> On 31 Aug 2013, at 4:36 am, MinRK <benjaminrk at gmail.com> wrote:
> 
> 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 used by any calls in the child process.​
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list