[zeromq-dev] Duplicate messages on subscriber reconnect in pub/sub pair

Benn Bollay benn at f5.com
Fri May 13 18:08:30 CEST 2011

> > Using bog standard code (see http://pastebin.com/W3AvhQn5), and then forcing
> > the tcp connection between the publisher and the subscriber to be reset, I
> > am seeing duplicate messages on the subscriber's side.  I've observed this
> > behavior both in 2.0 and in 2.1.7, and in C and python code.
> This is normal and expected. The PUB socket holds a small queue of
> outgoing messages so that new subscribers get some history (10
> messages or so, iirc). The SUB socket gets its messages, and then you
> break the connection and the SUB socket reconnects, thus appears to
> the PUB as a new subscriber.

Just to clarify - I don't believe this is any pub queuing case, since the duplications occur indefinitely.  Rather it's an issue with having the same 'fd' value registered in the internal data structures multiple times, since it never gets any kind of notification from epoll that the fd has been artificially closed.


More information about the zeromq-dev mailing list