[zeromq-dev] Python Streamer Push/Pull Device "losing" messages
cremes.devlist at mac.com
Fri Oct 21 06:26:41 CEST 2011
On Oct 20, 2011, at 11:21 PM, James Thornton wrote:
> On Thu, Oct 20, 2011 at 3:34 PM, James Thornton <james at jamesthornton.com> wrote:
>> When I run it, sometimes it will print that it receives all 1000
>> messages, sometimes it will be ~300, sometimes more or less -- it's so
>> intermittent as to how many messages it receives.
>> I'm using pyzmq 2.1.9 with ZMQ 2.1.4 on Fedora.
> Putting a sleep(5) at the end of the client function causes the client
> to remain open long enough for the socket to finish sending the
> messages to the worker:
> But LINGER is set to -1 on all sockets -- shouldn't that make each
> socket hold message indefinitely?
> What's going on here?
Using LINGER is the proper way to solve this in conjunction with zmq_close() and zmq_term() as your code now does.
Perhaps there was a bug with 2.1.4 (I don't recall... it's pretty old). Any chance you can retry with 2.1.10 and see if this behavior persists? I have similar code running under 2.1.10 and the LINGER works as expected.
More information about the zeromq-dev