Skip to content

fix: do not create the transport during warmup - #46

Merged
thetutlage merged 1 commit into
adonisjs:3.xfrom
DavideCarvalho:fix/warmup-mode
Oct 27, 2026
Merged

thetutlage merged 1 commit into
adonisjs:3.xfrom
DavideCarvalho:fix/warmup-mode

Conversation

@DavideCarvalho

Copy link
Copy Markdown
Contributor

What

The transmit singleton no longer calls config.transport.driver() when the app runs in the warmup mode, so no transport is created (transport stays null). This sits next to the existing warmup handling that disables the ping interval. Behavior in the run mode is unchanged.

Why

node ace codegen boots the app in the warmup mode (app.boot() + app.warmUp()) and then calls app.terminate(), which intentionally skips the providers' shutdown hooks for such an app:

Such an app never gets started and therefore it has nothing to tear down. Since every shutdown hook begins by resolving its manager from the container, invoking them would construct the very resources the warmed up app has avoided creating.

The transmit binding still gets resolved while warming up, because apps import the transmit service from their preload files (for example start/transmit.ts to register channel authorizations). With the redis transport, that creates a @boringnode/bus RedisTransport with two ioredis connections (publisher and subscriber). Nothing closes them, so node ace codegen never exits (in a real app we found dozens of hung codegen processes holding several GBs of memory).

Tests

  • Added a test that resolves transmit in the warmup mode (same approach as the existing ping interval test) and asserts the transport driver is never called. It fails without the fix.
  • The existing test asserting the driver is called in the run mode still passes.
  • npm test (which runs lint first) and npm run typecheck pass.

🤖 Generated with Claude Code

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>
@thetutlage
thetutlage merged commit 34684a4 into adonisjs:3.x Oct 27, 2026
8 checks passed
@thetutlage

Copy link
Copy Markdown
Member

Thanks 👍🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants