Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.6] Backport "Try to close race condition in FileWatching tests" #39978

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

ararslan
Copy link
Member

This backports Keno's FileWatching fix to the release-1.6 branch in hopes of fixing the x64 Linux failure in #39977. cc @KristofferC

* Try to close race condition in FreeBSD tests

We're seeing frequent test failures in the FileWatching test on
FreeBSD. Here's my theory of what happens:
 - Both the timer callback and the poll callback execute on the same libuv loop
 - They each schedule their respective tasks
 - Whichever task gets scheduled first first determines the result

However, in the test, we expect that, if the poll callback ran, (which we know
because we know there was an event pending), then that result does
actually get delivered to the toplevel task. This PR tries to close
this hole by adding the following condition:

If the task is no longer waiting on the file watcher (because libuv already
scheduled it), then wait for the task to run to completion, independent
of any timeout. I believe this should close the above race condition
and hopefully fix the test.

* Add another super-short timeout to try to trigger the same-tick issue

(cherry picked from commit 9a8a675)
@ararslan ararslan requested a review from vtjnash March 10, 2021 19:13
@ararslan
Copy link
Member Author

Looks like x64 Linux passed, so perhaps this had the desired effect.

@KristofferC
Copy link
Member

Let's try it. I'll rebase #39977

@KristofferC KristofferC merged commit 26372fa into release-1.6 Mar 10, 2021
@KristofferC KristofferC deleted the aa/backport-filewatching branch March 10, 2021 21:15
KristofferC pushed a commit that referenced this pull request Mar 10, 2021
* Try to close race condition in FreeBSD tests

We're seeing frequent test failures in the FileWatching test on
FreeBSD. Here's my theory of what happens:
 - Both the timer callback and the poll callback execute on the same libuv loop
 - They each schedule their respective tasks
 - Whichever task gets scheduled first first determines the result

However, in the test, we expect that, if the poll callback ran, (which we know
because we know there was an event pending), then that result does
actually get delivered to the toplevel task. This PR tries to close
this hole by adding the following condition:

If the task is no longer waiting on the file watcher (because libuv already
scheduled it), then wait for the task to run to completion, independent
of any timeout. I believe this should close the above race condition
and hopefully fix the test.

* Add another super-short timeout to try to trigger the same-tick issue

(cherry picked from commit 9a8a675)

Co-authored-by: Keno Fischer <keno@juliacomputing.com>
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
* Try to close race condition in FreeBSD tests

We're seeing frequent test failures in the FileWatching test on
FreeBSD. Here's my theory of what happens:
 - Both the timer callback and the poll callback execute on the same libuv loop
 - They each schedule their respective tasks
 - Whichever task gets scheduled first first determines the result

However, in the test, we expect that, if the poll callback ran, (which we know
because we know there was an event pending), then that result does
actually get delivered to the toplevel task. This PR tries to close
this hole by adding the following condition:

If the task is no longer waiting on the file watcher (because libuv already
scheduled it), then wait for the task to run to completion, independent
of any timeout. I believe this should close the above race condition
and hopefully fix the test.

* Add another super-short timeout to try to trigger the same-tick issue

(cherry picked from commit 9a8a675)

Co-authored-by: Keno Fischer <keno@juliacomputing.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants