Skip to content

Add plan-bounded resets for Fusion execution contexts - #10114

Merged
michaelstaib merged 3 commits into
mainfrom
mst/plan-bounded-reset
Jul 17, 2026
Merged

michaelstaib merged 3 commits into
mainfrom
mst/plan-bounded-reset

Conversation

@michaelstaib

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 14, 2026 23:03

Copilot AI 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.

Pull request overview

This PR introduces plan-bounded reset behavior for OperationPlanContext to avoid clearing per-node state across the full allocated capacity when only a smaller subset of node slots is active for a given OperationPlan/IncrementalPlan. It also derives plan capabilities (dynamic schema names, batch nodes) to further limit what state is reset/cleared.

Changes:

  • Add UsesDynamicSchemaNames / UsesBatchNodes capability derivation to OperationPlan and IncrementalPlan.
  • Update OperationPlanContext pooling + per-event reset logic to clear only the active node slot range and only the state required by the plan’s capabilities.
  • Add new tests covering subscription-event reuse resets and pool reuse across differently-sized plans (including an initialize-failure path).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/OperationPlanContextResetTests.cs Adds tests validating Begin() resets per-event state when the same context is reused for subscription events, and validates capability derivation.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/OperationPlanContextPoolingTests.cs Adds pooling tests ensuring state from large plans doesn’t leak into smaller plans and that failed initialization returns the context to the pool.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/OperationPlanContext.Pooling.cs Tracks active node slot count + plan capabilities during Initialize() and clears/disposes only the active range during Clean().
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/OperationPlanContext.cs Restricts per-event reset work to the active node slot range and capability-gated state.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/OperationPlan.cs Derives and stores plan capabilities (UsesDynamicSchemaNames, UsesBatchNodes) by scanning nodes.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Nodes/IncrementalPlan.cs Derives and stores plan capabilities (UsesDynamicSchemaNames, UsesBatchNodes) by scanning nodes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (83/83)

File Covered Changed Patch %
…/src/Fusion.Execution/Execution/Nodes/IncrementalPlan.cs 15 15 100.0% 🟢
…/Fusion/src/Fusion.Execution/Execution/Nodes/OperationPlan.cs 15 15 100.0% 🟢
…/Fusion.Execution/Execution/OperationPlanContext.Pooling.cs 35 35 100.0% 🟢
…/src/Fusion.Execution/Execution/OperationPlanContext.cs 17 17 100.0% 🟢
…/Execution/Results/FetchResultStore.Pooling.cs 1 1 100.0% 🟢

Project coverage: 53.7% (230851/429607 lines)

@michaelstaib
michaelstaib merged commit 70b4a26 into main Jul 17, 2026
147 checks passed
@michaelstaib
michaelstaib deleted the mst/plan-bounded-reset branch July 17, 2026 09:33
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