[zeromq-dev] LIBZMQ-325 - Crash on two sockets with same identity

Ian Barber ian.barber at gmail.com
Sat Mar 3 00:50:33 CET 2012


I've been looking at this issue (https://zeromq.jira.com/browse/LIBZMQ-325)
a little, and it looks to me like a race condition between the reaper
thread and the remote shutdown process if you connect two sockets with the
same identity and close them at about the same time. Because the closing is
async, there can be duplicate term messages sent to the same pipe, as a
reconnect happens with the same id. The obvious fix is removing the assert
at the bottom of void zmq::xrep_t::xterminated (pipe_t *pipe_) - I can't
see what this is guarding against particularly, so I don't think it should
have any downside.

However, I think a better fix might be around serialising or reclaiming the
pipe during connection establishing if there is a pipe with the same
identity being reaped - however, I'm not sure on the best place to
implement that, or if it's a good idea!

Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120302/60c4a4a9/attachment.htm>


More information about the zeromq-dev mailing list