Skip to content

fix(router): stop pinning schema AST in cached plan entries#3007

Closed
arutkowski00 wants to merge 2 commits into
wundergraph:mainfrom
mondaycom:adamru/upstream-bugfix-remove-schema-document
Closed

fix(router): stop pinning schema AST in cached plan entries#3007
arutkowski00 wants to merge 2 commits into
wundergraph:mainfrom
mondaycom:adamru/upstream-bugfix-remove-schema-document

Conversation

@arutkowski00

@arutkowski00 arutkowski00 commented Jun 24, 2026

Copy link
Copy Markdown

Problem

planWithMetaData stored schemaDocument (full router schema AST, ~200MB) in every Ristretto plan cache entry but never read it. After config reload, cached plans pinned the previous schema generation.

Fix

Remove the unused schemaDocument field.

Test plan

  • go test ./router/core/...

Part of config hot-reload memory leak investigation (monday.com #3221).

Summary by CodeRabbit

  • Refactor
    • Streamlined internal request planning by removing an unused piece of stored metadata.
    • Kept the visible operation handling flow the same, with no expected change in user behavior.

planWithMetaData stored schemaDocument (full router schema AST, ~200MB)
in every cached plan entry but never read it. Drop the field so plan
caches do not retain the old schema generation after config reload.
@arutkowski00 arutkowski00 requested a review from a team as a code owner June 24, 2026 21:13
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: de3a65fd-0643-486d-b0f2-b70e65a9f055

📥 Commits

Reviewing files that changed from the base of the PR and between 7b40f14 and f61826f.

📒 Files selected for processing (1)
  • router/core/operation_planner.go

Walkthrough

planWithMetaData in router/core/operation_planner.go no longer includes schemaDocument, and planOperation now returns only preparedPlan and operationDocument.

Changes

Operation planner metadata cleanup

Layer / File(s) Summary
Struct field removal
router/core/operation_planner.go
planWithMetaData now contains only preparedPlan and operationDocument.
Return value update
router/core/operation_planner.go
planOperation constructs and returns planWithMetaData without schemaDocument.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the change: removing schema AST retention from cached plan entries in the router cache.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.33%. Comparing base (5efb3c2) to head (1351019).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3007      +/-   ##
==========================================
- Coverage   60.27%   54.33%   -5.95%     
==========================================
  Files         477      243     -234     
  Lines       62471    29464   -33007     
  Branches     6131        0    -6131     
==========================================
- Hits        37656    16010   -21646     
+ Misses      24787    11883   -12904     
- Partials       28     1571    +1543     
Files with missing lines Coverage Δ
router/core/operation_planner.go 71.11% <ø> (ø)

... and 719 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dkorittki dkorittki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @arutkowski00, thanks for the contribution. This is safe to merge. Only needs a gofmt on router/core/operation_planner.go. Would do it myself but can't push to your branch. Can you do it?

@dkorittki

Copy link
Copy Markdown
Contributor

Closing this PR because this is now handled in #3023

@dkorittki dkorittki closed this Jun 26, 2026
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.

2 participants