Skip to content

fix(core): release detached location graphs after reload - #52635

Open
Dante-dan wants to merge 1 commit into
anomalyco:v2from
Dante-dan:location-mcp-release
Open

Dante-dan wants to merge 1 commit into
anomalyco:v2from
Dante-dan:location-mcp-release

Conversation

@Dante-dan

@Dante-dan Dante-dan commented Oct 2, 2026 •

Copy link
Copy Markdown

Issue for this PR

Refs #36677

This PR covers the active-borrower reload lifecycle leak discussed in that issue. It does not establish that the original idle CPU loop or accumulated MCP processes are resolved.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fix the active-borrower reload leak described by Just-Silver and underdark456. After reload replaces an RcMap entry under the same key, the old entry sees the replacement and treats itself as cached. With an infinite idle TTL, its layer scope never closes.

Patch Effect 4.0.0-rc.112 to compare entry identity when releasing: close the detached graph after its last borrower, without removing the replacement. The regression holds two borrowers across reload and checks both finalization and replacement reuse. This fixes that lifecycle leak; I have not reproduced the original idle CPU loop or measured the reported MCP process counts.

How did you verify your code works?

  • The new regression failed against the unpatched dependency in the initial investigation and passes with the patch.
  • bun run test test/location-layer.test.ts --timeout 60000: 25 passed. The initial default-timeout run had 22 passes and 3 five-second timeouts.
  • bun run check passed through the normal pre-push hook: lint reported 0 errors (17,479 existing warnings); all 36 typecheck tasks passed. Node type stripping, disabled Astro telemetry, and a writable Wrangler log path were used for the local environment.

Screenshots / recordings

Not applicable.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant