-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix thread wait to be resilient to real time clock changes on Linux #11213
Conversation
This change fixes a problem that happens when a thread uses a timed wait and the real time clock change in the system (e.g. due to the user action, time server sync, leap second, etc). In such case, the wait may end up waiting for shorter or longer period of time. It fixes the issue for Thread.Sleep and timed wait on a process local synchronization primitives by using CLOCK_MONOTONIC instead of CLOCK_REALTIME for waiting on cond vars. Unfortunately, the waits on cross process synchronication primitives like named mutexes always use CLOCK_REALTIME, so this fix works on process local primitives only.
Fixes #10918 |
@dotnet-bot test OSX10.12 x64 Checked Build and Test please |
@dotnet-bot test Ubuntu x64 Checked Build and Test please |
@dotnet-bot test Windows_NT x64 Debug Build and Test please |
@dotnet-bot test Windows_NT x64 Release Priority 1 Build and Test please |
Shouldn't this be merged for at least the LTS version 1.0.5? |
@gkhanna79 I think that @joepeer is right that this change should be made to the LTS version too. Do you agree? |
@janvorli Sounds reasonable. Please feel free to get PRs for 1.0.0 and 1.1.0 branches and email shiproom for them. |
…otnet#11213) This change fixes a problem that happens when a thread uses a timed wait and the real time clock change in the system (e.g. due to the user action, time server sync, leap second, etc). In such case, the wait may end up waiting for shorter or longer period of time. It fixes the issue for Thread.Sleep and timed wait on a process local synchronization primitives by using CLOCK_MONOTONIC instead of CLOCK_REALTIME for waiting on cond vars. Unfortunately, the waits on cross process synchronication primitives like named mutexes always use CLOCK_REALTIME, so this fix works on process local primitives only.
…otnet#11213) This change fixes a problem that happens when a thread uses a timed wait and the real time clock change in the system (e.g. due to the user action, time server sync, leap second, etc). In such case, the wait may end up waiting for shorter or longer period of time. It fixes the issue for Thread.Sleep and timed wait on a process local synchronization primitives by using CLOCK_MONOTONIC instead of CLOCK_REALTIME for waiting on cond vars. Unfortunately, the waits on cross process synchronication primitives like named mutexes always use CLOCK_REALTIME, so this fix works on process local primitives only.
…11213) (#12033) This change fixes a problem that happens when a thread uses a timed wait and the real time clock change in the system (e.g. due to the user action, time server sync, leap second, etc). In such case, the wait may end up waiting for shorter or longer period of time. It fixes the issue for Thread.Sleep and timed wait on a process local synchronization primitives by using CLOCK_MONOTONIC instead of CLOCK_REALTIME for waiting on cond vars. Unfortunately, the waits on cross process synchronication primitives like named mutexes always use CLOCK_REALTIME, so this fix works on process local primitives only.
…11213) (#12034) This change fixes a problem that happens when a thread uses a timed wait and the real time clock change in the system (e.g. due to the user action, time server sync, leap second, etc). In such case, the wait may end up waiting for shorter or longer period of time. It fixes the issue for Thread.Sleep and timed wait on a process local synchronization primitives by using CLOCK_MONOTONIC instead of CLOCK_REALTIME for waiting on cond vars. Unfortunately, the waits on cross process synchronication primitives like named mutexes always use CLOCK_REALTIME, so this fix works on process local primitives only.
@joepeer I've ported the change to both 1.0.x and 1.1.x |
Thanks. |
@gkhanna79 would probably be able to give you at least an approximate answer. |
Actually, @leecow can give the timeframe of the next release for the 1.x servicing builds. |
We have been releasing 1.x updates roughly every 2 months. That said, a possible July release will be dependent upon the high impact issues submitted as candidates for the release. |
This change fixes a problem that happens when a thread uses a timed wait
and the real time clock change in the system (e.g. due to the user action,
time server sync, leap second, etc). In such case, the wait may end up waiting
for shorter or longer period of time.
It fixes the issue for Thread.Sleep and timed wait on a process local synchronization
primitives by using CLOCK_MONOTONIC instead of CLOCK_REALTIME for waiting on
cond vars.
Unfortunately, the waits on cross process synchronication primitives like
named mutexes always use CLOCK_REALTIME, so this fix works on process local primitives
only.