ZMQ uses system time for polling timeout
Description
Environment
Linux
Activity
Show:

Guido G. August 29, 2013 at 9:07 AM
Closed long time ago.

PieterP December 19, 2011 at 1:32 AM
Yes, this patch is included in 2.1.11. Closing now.

Martin Sustrik December 12, 2011 at 7:11 AM
Fixed in trunk.
Pieter, can you please fix it in 2.1 and 3.0 and close the issue?

Mika Fischer December 2, 2011 at 8:06 PM
Done, thanks!

Martin Sustrik December 2, 2011 at 6:24 PM
Well spotted! To merge the fix into the development trunk, can you please send the signed off patch to the mailing list?
ZMQ uses gettimeofday (through zmq::clock_t) to determine if the timeout for zmq_poll was reached. This causes massive problems if for any reason the system time is reset into the past while zmq_poll is waiting, namely that ZMQ hangs for a potentially very long time.
ZMQ should not use gettimeofday but a steady clock that cannot be reset while the system is running to prevent this problem. The POSIX function clock_gettime(CLOCK_MONOTONIC, ...) could be an option.