Repository navigation
fix(Pool): release retired usage-TTL resources - #8310
Merged
tim-smart merged 14 commits intoSep 20, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 93c2efc The changes in this PR will be included in the next version bump. This PR includes changesets to release 31 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
williamrobertson13
had a problem deploying
to
fork
September 19, 2026 17:21 — with
GitHub Actions
Error
williamrobertson13
requested a deployment
to
fork
September 19, 2026 17:21 — with
GitHub Actions
Waiting
williamrobertson13
had a problem deploying
to
fork
September 19, 2026 17:25 — with
GitHub Actions
Failure
williamrobertson13
had a problem deploying
to
fork
September 19, 2026 17:25 — with
GitHub Actions
Error
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
williamrobertson13
had a problem deploying
to
fork
September 19, 2026 17:37 — with
GitHub Actions
Failure
williamrobertson13
had a problem deploying
to
fork
September 19, 2026 17:37 — with
GitHub Actions
Error
williamrobertson13
had a problem deploying
to
fork
September 19, 2026 17:44 — with
GitHub Actions
Failure
williamrobertson13
had a problem deploying
to
fork
September 19, 2026 17:44 — with
GitHub Actions
Error
Merged
Contributor
Author
|
thanks so much for fixing this up (and apologies for the slop PR submission)! |
arrudaricardo
pushed a commit
to arrudaricardo/effect
that referenced
this pull request
Sep 23, 2026
Co-authored-by: Tim Smart <hello@timsmart.co>
This was referenced Sep 24, 2026
Merged
This branch is waiting to be 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
Fix a memory leak in
Pool.makeWithTTLwith the usage strategy. Retired resources and consumed acquisition errors could remain in the TTL queue when the pool reached its target or minimum size.The usage strategy no longer keeps its own queue of items.
state.itemsis aSet, which iterates in insertion order, so the strategy retires the oldest non-invalidated entry ofstate.itemsdirectly andreclaimmoves a reclaimed item to the back by re-adding it. Nothing outside the pool's own state references an item, so it is released the moment it leaves the pool, whether by invalidation, a consumed acquisition failure, or shutdown. The pool core no longer contains any strategy-specific hooks; its only change is skippingonAcquirefor a failed acquisition that a borrower consumed while it was finalizing. Public types, last-lease finalization, FIFO retirement, and minimum-size behavior are preserved. Each retirement skips over invalidated busy items ahead of it in insertion order, which is the one cost of not keeping a separate list.Tests cover four GC retention cases, last-lease finalization, and FIFO/minimum-size behavior after head, middle, or tail removal. Pool and McpServer tests share a GC helper; GC cases are skipped on Bun and Deno. Includes an
effectpatch changeset.Validation
Validation on implementation commit
6c79fc749f:pnpm lintandGOMEMLIMIT=4GiB GOMAXPROCS=4 pnpm checkpassed.Earlier failing-before verification substituted pre-fix
Pool.tsfrom3d59ae6d5f: all four GC regressions failed and the other 39 Pool tests passed. With no strategy-owned queue there is no enqueue-after-removal window left to cover.Toolchain commands ran through
nix develop -c.Closes EFF-1425