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

Introduce timeout to prevent a hang in CancelledBuild #5290

Merged
merged 2 commits into from
Apr 17, 2020

Conversation

Forgind
Copy link
Member

@Forgind Forgind commented Apr 16, 2020

Works towards #5229.

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was so scared seeing this title, but in a test: 👍

@@ -1517,7 +1517,8 @@ public void CancelledBuild()

asyncResult.ExecuteAsync(null, null);
_buildManager.CancelAllSubmissions();
asyncResult.WaitHandle.WaitOne();
asyncResult.WaitHandle.WaitOne(10000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
asyncResult.WaitHandle.WaitOne(10000);
asyncResult.WaitHandle.WaitOne(TimeSpan.FromSeconds(10));

I always prefer the explicit overload, so you don't have to remember units.

@@ -1517,7 +1517,8 @@ public void CancelledBuild()

asyncResult.ExecuteAsync(null, null);
_buildManager.CancelAllSubmissions();
asyncResult.WaitHandle.WaitOne();
asyncResult.WaitHandle.WaitOne(10000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment the arbitrary timeout please.

@Forgind Forgind merged commit b445712 into dotnet:master Apr 17, 2020
@Forgind Forgind deleted the prevent-hang branch April 17, 2020 16:06
Forgind added a commit to dotnet-maestro-bot/msbuild that referenced this pull request Apr 24, 2020
Introduce timeout to prevent a hang in CancelledBuild, which failed recently.
sfoslund pushed a commit to sfoslund/msbuild that referenced this pull request May 15, 2020
Introduce timeout to prevent a hang in CancelledBuild, which failed recently.
rainersigwald added a commit that referenced this pull request Oct 26, 2020
This was attempted in #5290 but we hit a hang in this test again this week.
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.

None yet

2 participants