[zeromq-dev] Mac OS X: test_shutdown_stress sometimes fails
Christian Gudrian
christian at gudrian.org
Fri Nov 12 13:26:15 CET 2010
Am 12.11.2010 12:23, schrieb gonzalo diethelm:
> Is it correct that you want to return for any case that is not
> WSAEWOULDBLOCK?
No. Those cases get handled by the call to wsa_assert that follows the
while loop which calls abort in case of an error.
> Any chance you might have an infinite loop here, if send() keeps
> returning WSAEWOULDBLOCK? Should you limit the amount of times this loop
> could be executed?
That raises the question how to handle that case. There's no means of
communicating an error like this to the caller. If a call to
mailbox_t::send returns it is considered successful. So either we abort
the whole process (which appears wrong to me since WSAEWOULDBLOCK is
explicitly marked as "nonfatal") or we stay in an inifite loop. The
latter one is basically the thing the OS asks us to do: "The resource is
temporarily unavailable so try again later".
> Is it OK to always sleep 1 ms? Should you implement some kind of
> exponential back-off?
Perhaps. I implemented the shortest possible path to make
test_shutdown_stress pass that particular condition (which happens only
rarely when ZMQ faces heavy load).
Christian
More information about the zeromq-dev
mailing list