[zeromq-dev] zombies hang to branches in zmq::ctx_t::terminate

Gaspard Bucher gaspard at teti.ch
Tue Feb 8 11:48:21 CET 2011


>From my guess, the "zombie" won't let go and keeps haunting the application
because it has some unsent messages in its queue (PUSH socket).

I am using zmq.PUSH in the client to send updates to the server. If the
server is taken offline or is interrupted, there is a small lapse of time
before mDNS announces that the server is away. During this interval, the
client might try pushing more updates.

When we discover that the server went offline, we need to:

* optional: report that some updates are lost (this means queue inspection)
* remove the updates from the queue / cleanup

But by inspecting the process with gdb, it loops forever with:

dezombify() ---> process_commands(false, false) --->

rc = mailbox.recv (&cmd, false);
// ==> rc == -1 && errno == EAGAIN

Inspecting the zombie (there is only one):

this->term_acks = 2
this->owner = 0x0
this->tid = 6

So my guess is that there are 2 child sockets that depend on this one and
that refuse to quit / ack.

The zombie is an XREP that I did not create so it is strange that it has no
owner.

Gaspard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110208/be512bfb/attachment.htm>


More information about the zeromq-dev mailing list