[zeromq-dev] pyzmq poller and EINTR

Martin.Belanger at dell.com Martin.Belanger at dell.com
Tue Jan 15 16:48:46 CET 2019

The C library provides zmq_poll(), which returns -1 on error and set the errno accordingly. I'm particularly interested by errno=EINTR, which means: "The operation was interrupted by delivery of a signal before any events were available."

Now if we look at the Python code there is zmq.Poller.poll(timeout=None). This functions returns the list of events that are ready to be processed. There is no mention of how zmq.Poller.poll() behaves when a signal is received. In fact, I did a test and it seems that zmq.Poller.poll() simply cannot be interrupted. I need to implement a loop that is waiting forever on a couple of sockets. However, I want to be able to send a signal (HANGUP) to that process to tell it to stop polling and reload its configuration. Please let me know how I can do this.


More information about the zeromq-dev mailing list