Skip to content

Introduce timeout to prevent a hang in CancelledBuild#5290

Merged
Forgind merged 2 commits intodotnet:masterfrom
Forgind:prevent-hang
Apr 17, 2020
Merged

Introduce timeout to prevent a hang in CancelledBuild#5290
Forgind merged 2 commits intodotnet:masterfrom
Forgind:prevent-hang

Conversation

@Forgind
Copy link
Contributor

@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: 👍

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.

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
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.

2 participants