Message363346
Since bpo-15038, waiting to acquire locks/events/etc from _thread/threading on Windows can fail to return long past the requested timeout. Cause:
https://github.com/python/cpython/blob/3.8/Python/thread_nt.h#L85
using 32-bit GetTickCount/DWORD, which will overflow at around 49.7 days of uptime.
If the WaitForSingleObjectEx call in PyCOND_TIMEDWAIT returns later than the 'target' time, and the tick count overflows in that gap, 'milliseconds' will become very large (up to another 49.7 days) and the next PyCOND_TIMEDWAIT will be stuck for a long time.
Where we've seen it is where it's most likely to happen: when the machine is hibernated during the WaitForSingleObjectEx call. I believe the TickCount continues to increase during hibernation so there is a much bigger gap between 'target' and 'now' for the overflow to happen in.
Simplest fix is probably to switch to GetTickCount64/ULONGLONG. We should be able to get away with using this now we no longer support WinXP. |
|
Date |
User |
Action |
Args |
2020-03-04 13:20:27 | aclover | set | recipients:
+ aclover, paul.moore, tim.golden, zach.ware, steve.dower |
2020-03-04 13:20:26 | aclover | set | messageid: <1583328026.98.0.491106865905.issue39847@roundup.psfhosted.org> |
2020-03-04 13:20:26 | aclover | link | issue39847 messages |
2020-03-04 13:20:26 | aclover | create | |
|