Repository navigation
fix: do not resolve the queue manager when warming up the app - #12
Merged
Merged
Conversation
A warmed up app never gets started and its providers are never shut down. Resolving the queue manager during boot opens the adapter connections (for example, redis), which keeps the process alive after commands like "node ace codegen" terminate the app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The core peer dependency is now ^7.6.0, which always ships getMode and the warmup mode, so the defensive optional call is no longer needed.
RomainLanz
force-pushed
the
fix/warmup-mode
branch
from
October 18, 2026 09:37
1120cb3 to
e7691f8
Compare
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.
What
QueueProviderno longer resolves thequeue.managerbinding inboot()(nor loads jobs instart()) when the app runs in thewarmupmode. Behavior in therunmode is unchanged.getModeis called with optional chaining since older versions of the framework core within the^7.0.0peer range don't have it.Why
node ace codegenboots the app in thewarmupmode (app.boot()+app.warmUp()) and then callsapp.terminate(), which intentionally skips the providers'shutdownhooks for such an app:So providers must not open connections during register/boot in this mode. Today
boot()resolves the queue manager, which resolves the adapters, and theredisdriver acquires an ioredis connection right away. Nothing ever closes it, sonode ace codegennever exits (in a real app we found dozens of hung codegen processes holding several GBs of memory).The manager is still resolved lazily if something asks for it (for example
services/main).Related: #9 tackled the connection side by making the drivers lazy, but it was closed without merging.
Tests
warmupmode, boots and warms it up, and asserts the adapter's config provider is never resolved and no jobs are loaded. It fails without the fix.runmode.npm test,npm run lintandnpm run typecheckpass.🤖 Generated with Claude Code