-
Notifications
You must be signed in to change notification settings - Fork 606
Graceful stop of worker services #781
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
Conversation
In additional to that it would be possible to introduce either
or
thoughts? |
Considering that stoppage has been explicitly requested, I'd think the non-throwing options would make more sense, since you probably don't care about any new work being added at that point? |
That was also my idea but I didn't want to bias this discussion too much up front |
I also think the non-throwing version makes more sense. |
One thing though: Given that this check is in the hotpath and cannot be optimized away do we really want to do this? |
That's a good point. I think as long as the previously enqueued work items are processed, we are reasonably safe. |
Proposed Changes
As discussed in #771 this makes sure any work that is left is executed and stop only exits after the worker has exited.
The reintroduces the necessary evil
GetAwaiter().GetResult()
on the highest entry level possible to make the underlying call stack async all the way.The caveats of this have been discussed in the mentioned PR and seemed to have been outweighed against the benefits of finalizing the work.