You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is clear looking at the source code that the Queue class uses time() and other non-monotonic timing sources. So if a queue get function is called with a timeout value and the system time is changed during that get it could end up waiting in the get for potentially days. The easiest way to reproduce is to set the timeout in the get to 5 minutes and which it is waiting on the queue to get an entry set the system clock back a few years. You will notice it will not exit the get.
The text was updated successfully, but these errors were encountered:
I am using Python 3.8.6 on Linux.
Attached is python code that reproduces this problem. I set a specific date/time before the queue.get blocking call with a 10 second timeout and then change the date/time to a different date/time during the queue.get and it does not return after 10 seconds.
There is a variable in the attached script called Make_It_Fail that is set to True. You can set it to False to see how the script works without date/time changes then set it to True to see how queue.get does not return after 10 seconds has elapsed. queue_timeout_test.py.txt
I tried my queue_timeout.test.py script on Python 3.11 and it still does not timeout after 10 seconds. The queue.get() function blocks and seems to still be effected by changes to the system time on Linux.
It is clear looking at the source code that the Queue class uses time() and other non-monotonic timing sources. So if a queue get function is called with a timeout value and the system time is changed during that get it could end up waiting in the get for potentially days. The easiest way to reproduce is to set the timeout in the get to 5 minutes and which it is waiting on the queue to get an entry set the system clock back a few years. You will notice it will not exit the get.
The text was updated successfully, but these errors were encountered: