Spurious message when ROUTER connects
Description
Environment
OSX 10.7.2, pyzmq 2.1dev
Attachments
6
- 17 Dec 2011, 09:19 AM
- 14 Nov 2011, 10:55 AM
- 13 Nov 2011, 05:43 PM
- 08 Nov 2011, 09:59 PM
- 08 Nov 2011, 06:57 PM
- 08 Nov 2011, 01:00 AM
Activity
Show:
Martin Sustrik December 17, 2011 at 10:17 PM
Great! I'm resolving the issue.
Min RK December 17, 2011 at 4:06 PM
Indeed it appears fixed. What's more, the entire pyzmq test suite is passing. Hooray!
Thanks. Should I mark this as resolved, or leave that to you?
Martin Sustrik December 17, 2011 at 9:20 AM
The fix is committed to the trunk. Can you please retest? (Sorry for the delay.)
Martin Sustrik December 17, 2011 at 9:19 AM
C++ test case attached.
Min RK November 15, 2011 at 5:11 PM
I still see rep.cpp:75 in the pyzmq test suite with latest libzmq, and is easily reproducible by polling prior to rep.recv():
import zmq
ctx = zmq.Context.instance()
rep = ctx.socket(zmq.REP)
addr = "tcp://127.0.0.1:5555"
rep.bind(addr)
req = ctx.socket(zmq.REQ)
req.connect('tcp://127.0.0.1:5555')
req.send('hi')
poller = zmq.Poller()
poller.register(rep, zmq.POLLIN)
poller.poll(1)
rep.recv() # assert rep.cpp:75
When ROUTERs connect, they get messages that shouldn't exist.
Case 1: DEALER binds, ROUTER connects.
poll(ROUTER, POLLIN)
indicates that a message is waiting, but it never arrives.Case 2: two DEALERs bind, and ROUTER connects to both. poll(ROUTER, POLLIN) indicates that a message is waiting, and recv() will return the two-part message with the IDENTITY of the second DEALER.
Neither problem occurs when ROUTER is the binding socket.