- Notifications
You must be signed in to change notification settings - Fork1.1k
fix: stop reading closed channel for/watch devcontainers endpoint#19373
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Fixes#19372We increase the read limit to 4MiB (we use this limit elsewhere). Wealso make sure to stop sending messages of `containersCh` becomesclosed.
johnstcn 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.
If possible, I'd like to see a unit test or similar that reproduces the condition and validates the fix.
Uh oh!
There was an error while loading.Please reload this page.
DanielleMaywood commentedAug 15, 2025
I've added a test in0ca20dc If you remove the fix in |
johnstcn 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.
This looks OK to me, but I also wonder if there's a way for us to detect us reaching the payload limit and log an error somewhere?
DanielleMaywood commentedAug 15, 2025
We already do but as a coder/codersdk/wsjson/decoder.go Line 41 in0ca20dc
|
johnstcn commentedAug 15, 2025
Ah nice, so we can check for |
mafredri 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.
Minor nit, but LGTM, nice work!
| deferres.Body.Close() | ||
| } | ||
| conn.SetReadLimit(1<<22)// 4MiB |
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.
Nit: let's add a comment for this, as well as the compression, for posterity.
Re: compression, we might say that we chose nocontexttakeover to improve bandwidth cost/latency with minimal cpu/memory overhead even if contexttakeover has better compression.
205eb29 intomainUh oh!
There was an error while loading.Please reload this page.
Fixes#19372
We increase the read limit to 4MiB (we use this limit elsewhere). We also make sure to stop sending messages of
containersChbecomes closed.