Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

janvorli
Copy link
Member

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.

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.
@janvorli janvorli added area-PAL os-linux Linux OS (any supported distro) labels Apr 25, 2017
@janvorli janvorli self-assigned this Apr 25, 2017
@janvorli janvorli requested a review from kouvel April 25, 2017 22:00
@janvorli
Copy link
Member Author

Fixes #10918

@janvorli
Copy link
Member Author

@dotnet-bot test OSX10.12 x64 Checked Build and Test please

@janvorli
Copy link
Member Author

@dotnet-bot test Ubuntu x64 Checked Build and Test please

@janvorli
Copy link
Member Author

@dotnet-bot test Windows_NT x64 Debug Build and Test please

@janvorli
Copy link
Member Author

@dotnet-bot test Windows_NT x64 Release Priority 1 Build and Test please

@janvorli janvorli merged commit a5a8c6c into dotnet:master Apr 26, 2017
@joepeer
Copy link

joepeer commented May 26, 2017

Shouldn't this be merged for at least the LTS version 1.0.5?
Without the fix we will get weird behavior when the clock gets adjusted for day light saving time.

@janvorli janvorli deleted the fix-thread-wait branch May 29, 2017 08:44
@janvorli
Copy link
Member Author

@gkhanna79 I think that @joepeer is right that this change should be made to the LTS version too. Do you agree?

@gkhanna79
Copy link
Member

@janvorli Sounds reasonable. Please feel free to get PRs for 1.0.0 and 1.1.0 branches and email shiproom for them.

janvorli added a commit to janvorli/coreclr that referenced this pull request Jun 1, 2017
…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.
janvorli added a commit to janvorli/coreclr that referenced this pull request Jun 1, 2017
…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.
janvorli added a commit that referenced this pull request Jun 1, 2017
…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.
janvorli added a commit that referenced this pull request Jun 1, 2017
…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.
@janvorli
Copy link
Member Author

janvorli commented Jun 2, 2017

@joepeer I've ported the change to both 1.0.x and 1.1.x

@joepeer
Copy link

joepeer commented Jun 2, 2017

Thanks.
Any idea when the new LTS that should include the fix will get released?

@janvorli
Copy link
Member Author

janvorli commented Jun 2, 2017

@gkhanna79 would probably be able to give you at least an approximate answer.

@gkhanna79
Copy link
Member

Actually, @leecow can give the timeframe of the next release for the 1.x servicing builds.

@leecow
Copy link
Member

leecow commented Jun 5, 2017

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.

@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-PAL os-linux Linux OS (any supported distro)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants