Repository navigation
fix(events): end a reliable subscription when its context is cancelled - #56
Merged
Merged
Conversation
Signed-off-by: Akhil Repala <arepala@blinklabs.io>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
wcatz
approved these changes
Nov 26, 2026
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.
Closes #55
Receiveuntil the server sent another message.runReliablenow registerscontext.AfterFuncto close the request and response halves of the stream on cancel;RunEventStreamstill returns nil, sosignalExitkeeps the 128+signal exit status.runPlainis unchanged: its request body is closed after the single request, so the transport already watches the context.TestRunEventStreamReliableCancelWhileIdle: the server sends two events, takes both acks, and goes quiet; the test cancels and requiresRunEventStreamto return nil within 2s. It failed 5/5 before the change.Checks:
make build,make vet,gofmt -s -l,golangci-lint run(0 issues),go test -race ./..., new test with-race -count=30.Summary by cubic
Fixes reliable subscriptions so cancelling their context ends a blocked
Receiveinstead of stalling until the server sends again. Closes #55.Once response headers arrive, the HTTP/2 transport checks the request context only while writing the request body. A reliable subscriber that has sent all its acks leaves the writer parked on the empty request pipe, so a cancel didn't end the stream until the next server message.
runReliablenow registerscontext.AfterFuncto close both request and response halves on cancel;RunEventStreamstill returns nil, so the 128+signal exit status is kept.runPlainis unchanged.Adds
TestRunEventStreamReliableCancelWhileIdle, which sends two events, takes both acks, and goes quiet; cancelling must return nil within 2s. The test failed before the change.Written for commit 5912da4. Summary will update on new commits.