Repository navigation
fix: do not create the transport during warmup - #46
Merged
Merged
Conversation
A warmed up app never gets started and its providers are never shut down. Creating the transport (for example, redis) opens connections that nothing closes, which keeps the process alive after commands like "node ace codegen" terminate the app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Thanks 👍🏽 |
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
The
transmitsingleton no longer callsconfig.transport.driver()when the app runs in thewarmupmode, so no transport is created (transportstaysnull). This sits next to the existing warmup handling that disables the ping interval. Behavior in therunmode is unchanged.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:The
transmitbinding still gets resolved while warming up, because apps import the transmit service from their preload files (for examplestart/transmit.tsto register channel authorizations). With the redis transport, that creates a@boringnode/busRedisTransportwith two ioredis connections (publisher and subscriber). Nothing closes them, sonode ace codegennever exits (in a real app we found dozens of hung codegen processes holding several GBs of memory).Tests
transmitin thewarmupmode (same approach as the existing ping interval test) and asserts the transport driver is never called. It fails without the fix.runmode still passes.npm test(which runs lint first) andnpm run typecheckpass.🤖 Generated with Claude Code