[zeromq-dev] Handling EINTR on REQ socket recv

Jake jake.cobb at gmail.com
Wed May 15 17:41:39 CEST 2019


Hi all,

For reasons that are not entirely clear to me, I am sometimes seeing
"Interrupted system call" from the recv on the REQ end of a
REQ-ROUTER-DEALER-REP socket chain on MacOS.  There is no Ctrl+c/SIGTERM or
anything obvious like that happening.  The REQ socket use is blocking send
followed by blocking receive with timeout socket options set.

If the recv fails due to EINTR, I believe the state machine of REQ/REP will
not allow another recv, is that correct and is there any way to gracefully
handle this condition?  Would I need to switch to polling instead of
blocking with timeout?

The REP worker is getting the message and sending a reply, so it seems only
the requester is seeing this as a failure and not due to network
conditions.  For failures due to timeout, we just tear down the socket and
reconnect for the next request, but in this case I expect there is a valid
reply to receive.

-Jake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20190515/1850411b/attachment.htm>


More information about the zeromq-dev mailing list