Repository navigation
Dispose type module change monitor on failed executor creation - #9902
Merged
tobias-tengler merged 2 commits intoJun 11, 2026
Merged
tobias-tengler merged 2 commits into
tobias-tengler merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses Hot Chocolate issue #9901 where failed executor rebuilds could leak TypeModule.TypesChanged subscriptions, leading to exponentially increasing TypeModule.CreateTypesAsync() invocations after repeated OnTypesChanged() signals. The core fix ensures the type module change monitor is disposed when executor creation fails, and adds a regression test to detect subscription leaks when a type instance is registered.
Changes:
- Dispose
TypeModuleChangeMonitor(and schema service provider) when request executor creation fails, preventing leaked event subscriptions. - Add a regression test covering repeated
OnTypesChanged()triggers with a registered type instance to ensureCreateTypesAsync()calls don’t grow exponentially.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/HotChocolate/Core/src/Types/Execution/RequestExecutorManager.cs |
Wrap executor creation in try/catch and dispose the change monitor (and schema services) on failure to prevent leaked TypesChanged subscriptions. |
src/HotChocolate/Core/test/Execution.Tests/RequestExecutorManagerTests.cs |
Adds a regression test that triggers OnTypesChanged() repeatedly and asserts CreateTypesAsync() calls don’t grow beyond the number of triggers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tobias-tengler
deleted the
tte/cleanup-typemodule-registration-if-executor-creation-fails
branch
June 11, 2026 16:20
This was referenced Jun 16, 2026
This was referenced Jun 19, 2026
This was referenced Jun 26, 2026
This was referenced Jul 24, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Aug 31, 2026
This was referenced Sep 8, 2026
This was referenced Sep 17, 2026
This was referenced Sep 28, 2026
This was referenced Oct 5, 2026
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.
Fixes #9901