-
Notifications
You must be signed in to change notification settings - Fork 524
Conversation
davidfowl
commented
Apr 21, 2017
- Increase timeouts for thread and listener shutdowns
- Use PostAsync to observe ObjectDisposedExceptions in the shutdown sequence
- Increase timeouts for thread and listener shutdowns - Use PostAsync to observe ObjectDisposedExceptions in the shutdown sequence
@@ -103,15 +102,15 @@ public Task StartAsync() | |||
{ | |||
var stepTimeout = TimeSpan.FromTicks(timeout.Ticks / 3); | |||
|
|||
Post(t => t.AllowStop()); | |||
await PostAsync(t => t.AllowStop(), this).ConfigureAwait(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this prevent StopAsync from completing if the event loop is deadlocked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it will. I'll add a check in AllowStop itself. It's safer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the benefit of PostAsync here if we are waiting for _threadTcs.Task to complete anyway?
@@ -123,7 +123,7 @@ await Task.WhenAll(Threads.Select(thread => thread.StopAsync(TimeSpan.FromSecond | |||
{ | |||
var disposeTasks = _listeners.Select(listener => listener.DisposeAsync()).ToArray(); | |||
|
|||
if (!await WaitAsync(Task.WhenAll(disposeTasks), TimeSpan.FromSeconds(2.5)).ConfigureAwait(false)) | |||
if (!await WaitAsync(Task.WhenAll(disposeTasks), TimeSpan.FromSeconds(5)).ConfigureAwait(false)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you see this being timed out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any evidence that the ODEs are coming from AllowStop, OnStopRude or OnStopImmediate? |
Spoke to @halter73 about this and decided to just remove the unreference from AllowStopRude |
|