-
Notifications
You must be signed in to change notification settings - Fork 49
Fix the websocket shutdown behavior #483
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #483 +/- ##
==========================================
+ Coverage 79.55% 79.61% +0.06%
==========================================
Files 27 27
Lines 11688 11683 -5
==========================================
+ Hits 9298 9302 +4
+ Misses 2390 2381 -9 ☔ View full report in Codecov by Sentry. |
| websocket->thread_data.is_reading_stopped = true; | ||
| websocket->thread_data.is_writing_stopped = 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.
Oh man, I totally didn't notice these changes in that other PR.
I'll take over this PR. I'm oncall
…, vs calls from off-thread caused directly by the user
TingDaoK
left a comment
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.
Cannot approve, but ![]()
Update submodules, bringing in this fix: awslabs/aws-c-http#483 ``` aws-c-common v0.9.26 -> v0.9.27 aws-c-event-stream v0.4.2 -> v0.4.3 aws-c-http v0.8.7 -> v0.8.8 ```
Update submodules, bringing in this fix: awslabs/aws-c-http#483 ``` aws-c-common v0.9.26 -> v0.9.27 aws-c-event-stream v0.4.2 -> v0.4.3 aws-c-http v0.8.7 -> v0.8.8 ```
The bug was introduced in PR #474
is_writing_stopped = trueshouldn't be set directly, there's a helper functions_stop_writing()that ensures subsequent calls toaws_websocket_send_frame()will fail.Let's take a whole new approach these channel-shutdown-window-deadlock issues:
s_stop_reading_and_dont_block_shutdown()function that setsis_reading_stopped = true, but also increments the read window so that channel shutdown won't deadlock.is_reading_stopped = truenow use this helper insteadaws_channel_shutdown()is called. Lots of channel behavior has changed since this websocket code was written.aws_channel_shutdown()s_schedule_channel_shutdown_from_offthead()aws_websocket_close(), or when the refcount goes to zero, we can assume the user is OK if reading stops, and it can calls_stop_reading_and_dont_block_shutdown()on the way to shutting down.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.