-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Close connections asynchronously and improve gracefulness #6762
Close connections asynchronously and improve gracefulness #6762
Conversation
{ | ||
this.Context.Transport.Output.CancelPendingFlush(); | ||
outgoingCompleted = true; | ||
} |
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.
I think the result here is that it ends up not gracefully draining the connection before shutdown
c4fa6b3
to
0d2b21a
Compare
I pushed an update on top of your commit, @JohnMorman, and closed the PR I had open (#6877) |
0d2b21a
to
e4f9207
Compare
@benjaminpetit since I made large changes here, could you please take a look, too? |
…elPendingFlush()/.CancelPendingRead() on the same pipe which results in an ObjectDisposedException
e4f9207
to
545e73e
Compare
* Lock around connection cleanup so we don't call .Complete() and .CancelPendingFlush()/.CancelPendingRead() on the same pipe which results in an ObjectDisposedException * Close connections asynchronously and improve gracefulness Co-authored-by: ReubenBond <rebond@microsoft.com>
* Close connections asynchronously and improve gracefulness (#6762) * Lock around connection cleanup so we don't call .Complete() and .CancelPendingFlush()/.CancelPendingRead() on the same pipe which results in an ObjectDisposedException * Close connections asynchronously and improve gracefulness Co-authored-by: ReubenBond <rebond@microsoft.com> * Adding await for GatewayListNotification * Updating GatewayManager interfaces Co-authored-by: John Morman <jmorman@microsoft.com> Co-authored-by: ReubenBond <rebond@microsoft.com>
Lock around connection cleanup so we don't call .Complete() and .CancelPendingFlush()/.CancelPendingRead() on the same pipe which results in an ObjectDisposedException.Fixes #6747
EDIT by @ReubenBond:
Updated PR description
Connection.CloseAsync(Exception)
method, which closes the connection asynchronously, completing the returned task once it has