Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix close writing even if context is cancelled #329

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

Closed
wants to merge 1 commit into from

Conversation

kylecarbs
Copy link
Member

In an HTTP handler where the context is used for cleanup, a goroutine would leak temporarily. By using the write context, it should block the WebSocket from sending the close frame at all if cancelled.

In an HTTP handler where the context is used for cleanup, a goroutine would leak temporarily. By using the write context, it should block the WebSocket from sending the close frame at all if cancelled.
@kylecarbs kylecarbs requested a review from nhooyr as a code owner February 20, 2022 19:48
kylecarbs added a commit to coder/coder that referenced this pull request Feb 20, 2022
There's an upstream PR open to fix the issue. This should patch it
to make our CI work! For details, see: coder/websocket#329
@kylecarbs
Copy link
Member Author

I needed to defer Close() in my HTTP handler, and this issue no longer exists!

@kylecarbs kylecarbs closed this Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant