Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix(ws server): fix shutdown on connection closed #1103
fix(ws server): fix shutdown on connection closed #1103
Changes from 3 commits
7579dee
0199743
24d48d1
e2a8e31
0a564f8
1e35bb6
98626f5
3cd4c09
91cde24
51b3a84
c2d6d25
b216f77
1115b9a
7b6b58e
19106c1
d17676f
47abd27
d58a496
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Am I right in thinking that:
Stopped
means the user has manually stopped the server, so we want to gracefully close the eonnctionConnectionClosed
means the connection was closed for some other reason (eg network issue or whatever)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, this is only fails if the
send_task
has been completed and the receiver of the bounded channel has been dropped.this can only occur if the
send_ping
fails I think i.e, connection closedThere 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.
it's possible that the connection is terminated during the graceful shutdown and this ensures that it is aborted once the close message is sent.
however, this is slightly error prone if the no proper close is sent but yeah would neat if soketto had something to indicate when the connection is closed
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.
So basically, whatever finishes first out of disconnect (which looks like any final things to be received?) and pending (whihc looks like anything to be sent back?) will lead to the thing ending?
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 find it a bit hard to follow the logic here!
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.
yeah, it's way to make it possible to detect whether connection has terminated while we try to wait for the pending futures to complete