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

Benn Bollay benn at f5.com
Fri May 13 00:36:15 CEST 2011


Hi all -

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.

Basic timeline of events:

*         Start up publisher on some regular message generation loop

*         Start up subscriber connecting to publisher.

*         Validate that subscriber sees one message per publisher message.

*         Force the connection to be closed - in my case, I attached gdb to the python process and close(fd)'ed the non-listening socket (easily identifiable via lsof).

*         The subscriber auto-reconnects, but now receives duplicates of every message being sent.

My questions:

*         Is this expected?

*         What should I be doing differently to prevent this from happening?

Cheers,
--B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110512/4c1bb0a9/attachment.htm>


More information about the zeromq-dev mailing list