PUB/SUB Socket Deletion & Recreation Race Condition
Description
Environment
Gentoo Linux w/ pyzmq 2.1.10
Attachments
1
- 07 Jun 2012, 12:46 PM
Activity
Show:
Guido G. August 29, 2013 at 10:45 AM
Issue fixed as of last comment above.
Tom Cocagne March 19, 2013 at 5:05 PM
I just checked this issue on ZeroMQ 3.2.2 and PyZMQ 2.2.0.1. The problem no longer occurs.
Martin Hurton June 27, 2012 at 6:28 AM
Tom, I would like to look into this. Could you put together a simple C program to reproduce this behavior?
Tom Cocagne June 17, 2012 at 3:24 AM
I just ran the script against 3.2.0-rc1 and pyzmq 2.2.0 and can confirm that the issue remains unresolved in 3.2
PieterP June 16, 2012 at 5:17 PM
Tom, can you check whether this happens on 3.2?
This script demonstrates a race condition between destruction and recreation of ipc:/// sockets on ZeroMQ 2.1.11
The code below does the following in a continuous loop
1. create 3 interconnected PUB/SUB nodes
2. Periodically broadcast a packet from each node
3. Wait in a select loop until each node has received at least one packet from each other node
4. Shutdown each node (close all it's zmq sockets)
When run at top speed, the code only successfully completes one or two iterations before all messages are permanently lost from one or more PUB sockets. With a short delay between the outer loops (and hence the socket closure and recreation) the code is successfull every time.