Repository navigation
Conversation
…url errors Replace the per-stream watcher goroutine in convention/resumablestream with context.AfterFunc so unclosed streams using long-lived contexts do not leak goroutines. Also classify permanent x509/TLS and scheme-mismatch *url.Error failures as non-retryable. Fixes QoderAI#43
This branch has not been deployed
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
go s.closeOnContext()watcher goroutine inconvention/resumablestreamwithcontext.AfterFunc(streamCtx, s.closeOnContext)and deregister it beforecancel()onClose(), terminal events, andfail().x509.UnknownAuthorityError,x509.HostnameError,x509.CertificateInvalidError,x509.SystemRootsError,x509.ConstraintViolationError,x509.InsecureAlgorithmError,tls.RecordHeaderError) andhttp.ErrSchemeMismatcherrors wrapped in*url.Erroras non-retryable while keeping transient*url.Errorfailures retryable.convention/resumablestream/resumablestream_test.goand an[Unreleased]changelog entry.Fixes #43
Why
Previously, constructing a resumable stream with a long-lived context (such as
context.Background()) leaked a parked watcher goroutine wheneverClose()was omitted, and permanent TLS/scheme errors wrapped in*url.Errorretried indefinitely.Verification
make lint(gofmt -l+go vet ./...)make buildmake test(go test -race -count=1 ./convention/resumablestream/... ./forward/... ./managed/...)make docs-check(local toolchain is Go 1.24; CI checks docs on pinned Go 1.26; no exported API signatures changed)go build ./examples/...Commands and results:
Impact
*url.Errorstops retrying)CHANGELOG.mdunderUnreleasedcontext.AfterFuncand*url.Errorclassification).env.live, logs, or generated test output committed