Repository navigation
fix(sdk): release completed embedded request signals - #53082
Closed
opencode-agent[bot] wants to merge 1 commit into
Closed
opencode-agent[bot] wants to merge 1 commit into
opencode-agent[bot] wants to merge 1 commit into
Conversation
Contributor
|
Superseded by #53613. |
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.
Problem
In the embedded SDK, a live host keeps completed Web
Requestobjects after response consumption and GC. With 200 sequentialserver.info()calls, 201Requestobjects remain after a 100 ms idle turn; a plain handler does not show the same growth. The combination of the Effect Web handler andAbortSignal.any([source.signal, shutdown.signal])retains requests until the host shuts down. This is distinct from the projection worker backlog in anomalyco/anomaly#623.Fix
Bridge caller cancellation and host shutdown through a per-request controller, then detach both upstream abort listeners when the response completes or is cancelled. This keeps active-request cancellation and shutdown behavior without keeping completed requests attached to the long-lived host signal.
Verification
Requestobjects on the base branch, fewer than 20 after this change; repeat runs pass.bun typecheck, scoped oxlint, Prettier, andgit diff --checkpass.transport.test.tsandpromise.test.tshave three unrelated assertion failures in this checkout, reproduced on the unchanged base; this change does not add failures in those files.This is a source fix for review, not a production deployment. The production profile's full RSS/array-buffer footprint has not been attributed solely to these request objects. Related: anomalyco/anomaly#260 and draft #51012 (its earlier approach did not fix the embedded path).
Requested by: @kitlangton (Kit via Slack)