[zeromq-dev] Bad file descriptor in rm_fd()

Pieter Hintjens ph at imatix.com
Wed Nov 6 16:44:28 CET 2013


On Wed, Nov 6, 2013 at 4:31 PM, <Richard_Newton at waters.com> wrote:
>
> OK, so investigating this, I think https://github.com/zeromq/libzmq/pull/738 may solve the issue.
>
> What I think is happening is ctx_t::terminate, we set the state to terminating then immediately unlock and relock the slot_sync lock.
>
> If the last destroy_socket gets in while we are brief unlocked, both destroy_socket and terminate will issue a reaper->stop (), so we will call process_stop twice.
>
> Anyone know why we do the unlock/relock dance?


I'd guess this was an attempt by Sustrik to make the shutdown work
properly. It's always been a difficult part of the design.

-Pieter



More information about the zeromq-dev mailing list