Repository navigation
server: recover panics in the ByteStream Write put goroutine so a decoder panic fails one write, not the process - #66
Merged
Conversation
The recovery interceptors only cover the handler goroutine. ByteStream Write hands the body to putUpload on its own goroutine (where the zstd decoder runs for compressed uploads), so a panic there still exited the process. Recover it, fail just that write with codes.Internal, and close the pipe so the recv loop unblocks. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
|
ajwerner
approved these changes
Oct 27, 2026
devin-ai-integration Bot
added a commit
that referenced
this pull request
Oct 27, 2026
Merges patchset (#66) into this branch so the Bazel test target covers every _test.go in server/ and the release build compiles from the current patchset head. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
shreyas-blacksmith
added a commit
that referenced
this pull request
Oct 27, 2026
* server: add grpc_recovery.go and its test to BUILD.bazel * server: list grpc_bytestream_put_panic_test.go in the Bazel go_test too Merges patchset (#66) into this branch so the Bazel test target covers every _test.go in server/ and the release build compiles from the current patchset head. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * server: keep the go_test srcs in gazelle order --------- Co-authored-by: Codesmith Staging <codesmith-bot@users.noreply.github.com> Co-authored-by: shreyas@blacksmith.sh <shreyas@blacksmith.sh> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Summary
Follow-up to #65. The recovery interceptors added there only cover the handler goroutine.
ByteStream/Writehands the body toputUploadon its own goroutine via anio.Pipe, and for compressed uploads that is where the zstd decoder runs, so a panic there still exited the process.Recover in the put goroutine
The write fails with
codes.Internal, the pipe is closed so the recv loop unblocks, and the CAS write slot is still released.Test
TestGrpcByteStreamWritePutPanicFailsOnlyThatWritewraps the disk cache soPutpanics, sends a write, expectsInternal, and checks the server still answersGetCapabilities. Without the recover it crashes the test binary.Worth including in
v2.6.1-blacksmith.14if it hasn't been cut yet; otherwise it can ride the next tag, since the klauspost bump in #65 is the actual fix.Link to Devin session: https://app.devin.ai/sessions/c4fbdf7fdaee45c89654f8496af5720b
Open in Devin Desktop: https://app.devin.ai/desktop/session/c4fbdf7fdaee45c89654f8496af5720b?variant=devin
Requested by: @rcooney-sh
Need help on this PR? Tag
@codesmith-botwith what you need. (Staging)Need help on this PR? Tag
@codesmith-botwith what you need.