GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(dev): stop max listeners exceeded warning messages when running more than 10 runs concurrently by ericallam · Pull Request #2771 · triggerdotdev/trigger.dev

Conversation

@ericallam

@ericallam ericallam commented Dec 8, 2025 •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Note

Centralizes SIGTERM handling in DevSupervisor and removes per-run SIGTERM listeners in DevRunController to avoid MaxListenersExceededWarning under high concurrency.

  • Dev runtime:
    • SIGTERM handling: Add centralized handler in packages/cli-v3/src/dev/devSupervisor.ts to gracefully stop all run controllers; unregisters on shutdown().
    • Cleanup: Remove per-controller SIGTERM listener and handler from packages/cli-v3/src/entryPoints/dev-run-controller.ts to reduce event listeners and warnings.
  • Changeset: Add patch note in .changeset/fuzzy-ghosts-admire.md.

Written by Cursor Bugbot for commit 5ad2f53. This will update automatically on new commits. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@changeset-bot

changeset-bot Bot commented Dec 8, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5ad2f53

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 26 packages
Name Type
trigger.dev Patch
d3-chat Patch
references-d3-openai-agents Patch
references-nextjs-realtime Patch
references-realtime-hooks-test Patch
references-realtime-streams Patch
references-telemetry Patch
@trigger.dev/build Patch
@trigger.dev/core Patch
@trigger.dev/python Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/schedule-engine Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/zod-worker Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Dec 8, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

SIGTERM handling for graceful shutdown was centralized in DevSupervisor: a SIGTERM handler is added that stops all active DevRunController instances and awaits their completion with Promise.allSettled; the handler is registered at initialization and removed on shutdown. Corresponding per-controller SIGTERM handling was removed from DevRunController (constructor registration, private sigterm method, and cleanup in stop). A changeset entry was added documenting a patch fix for "max listeners exceeded" warnings when running >10 concurrent runs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify DevSupervisor correctly discovers/tracks all active DevRunController instances before invoking stop().
  • Confirm Promise.allSettled usage preserves and surfaces errors appropriately (no silent failure masking).
  • Ensure SIGTERM handler is registered at the correct lifecycle point and reliably removed during supervisor shutdown.
  • Validate removal of per-controller SIGTERM listeners eliminates the listener-count issue without introducing other memory leaks or missed shutdown paths.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete, missing most required template sections like the issue link, checklist items, testing steps, and changelog details. Fill in the Closes #, complete the checklist, add detailed testing steps, and provide a clear changelog summary to match the template structure.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing max listeners warnings by refactoring SIGTERM handling to the DevSupervisor level when running concurrent runs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea23888 and 5ad2f53.

📒 Files selected for processing (3)
  • .changeset/fuzzy-ghosts-admire.md (1 hunks)
  • packages/cli-v3/src/dev/devSupervisor.ts (1 hunks)
  • packages/cli-v3/src/entryPoints/dev-run-controller.ts (0 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands and usage tips.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nicktrn
nicktrn approved these changes Dec 8, 2025
View reviewed changes
coderabbitai[bot]
coderabbitai Bot reviewed Dec 8, 2025
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/cli-v3/src/dev/devSupervisor.ts (1)

141-143: Centralized SIGTERM handling in DevSupervisor looks correct and should fix the max listeners warnings.

Registering a single process.on("SIGTERM", this.#handleSigterm) in init() and removing it in shutdown() avoids per‑run listeners and the associated MaxListenersExceededWarning, while #handleSigterm correctly iterates all runControllers and stops them concurrently with Promise.allSettled.

Two small, non‑blocking refinements you might consider:

  • Log rejected results from Promise.allSettled so unexpected failures in controller.stop() are visible in dev logs.
  • Optionally guard against re‑entrancy (e.g., if multiple SIGTERMs arrive) with a simple flag so you don’t trigger multiple global stop sequences in parallel, though this is mostly defensive.

Overall, the lifecycle and cleanup behavior here looks sound.

Also applies to: 148-156, 159-159

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7fba9e9 and ea23888.

📒 Files selected for processing (3)
  • .changeset/fuzzy-ghosts-admire.md (1 hunks)
  • packages/cli-v3/src/dev/devSupervisor.ts (1 hunks)
  • packages/cli-v3/src/entryPoints/dev-run-controller.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • packages/cli-v3/src/entryPoints/dev-run-controller.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

Files:

  • packages/cli-v3/src/dev/devSupervisor.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

Files:

  • packages/cli-v3/src/dev/devSupervisor.ts
**/*.{js,ts,jsx,tsx,json,md,css,scss}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using Prettier

Files:

  • packages/cli-v3/src/dev/devSupervisor.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 2593
File: packages/core/src/v3/workers/warmStartClient.ts:168-170
Timestamp: 2025-10-08T11:48:12.327Z
Learning: The trigger.dev runners execute only in Node 21 and 22 environments, so modern Node.js APIs like AbortSignal.any (introduced in v20.3.0) are supported.
📚 Learning: 2025-10-08T11:48:12.327Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 2593
File: packages/core/src/v3/workers/warmStartClient.ts:168-170
Timestamp: 2025-10-08T11:48:12.327Z
Learning: The trigger.dev runners execute only in Node 21 and 22 environments, so modern Node.js APIs like AbortSignal.any (introduced in v20.3.0) are supported.

Applied to files:

  • .changeset/fuzzy-ghosts-admire.md
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Run `npx trigger.devlatest dev` to start the Trigger.dev development server

Applied to files:

  • .changeset/fuzzy-ghosts-admire.md
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Control concurrency using the `queue` property with `concurrencyLimit` option

Applied to files:

  • .changeset/fuzzy-ghosts-admire.md
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `runs.subscribeToBatch()` to subscribe to changes for all runs in a batch

Applied to files:

  • .changeset/fuzzy-ghosts-admire.md
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Limit task duration using the `maxDuration` property (in seconds)

Applied to files:

  • .changeset/fuzzy-ghosts-admire.md
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `batch.trigger()` to trigger multiple different tasks at once from backend code

Applied to files:

  • .changeset/fuzzy-ghosts-admire.md
📚 Learning: 2024-10-18T15:41:52.352Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 1418
File: packages/core/src/v3/errors.ts:364-371
Timestamp: 2024-10-18T15:41:52.352Z
Learning: In `packages/core/src/v3/errors.ts`, within the `taskRunErrorEnhancer` function, `error.message` is always defined, so it's safe to directly call `error.message.includes("SIGTERM")` without additional checks.

Applied to files:

  • packages/cli-v3/src/dev/devSupervisor.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (24)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: typecheck / typecheck
🔇 Additional comments (1)
.changeset/fuzzy-ghosts-admire.md (1)

1-5: Changeset metadata and summary look consistent with the code change.

The package name, bump type, and description clearly match the intent of centralizing SIGTERM handling to avoid max listeners warnings; nothing else to change here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
matt-aitken
matt-aitken approved these changes Dec 8, 2025
View reviewed changes
@ericallam
fix(dev): stop max listeners exceeded warning messages when running m…
5ad2f53
…ore than 10 runs concurrently
@ericallam
ericallam force-pushed the fix/dev-cli-max-listeners-exceeded branch from ea23888 to 5ad2f53 Compare December 9, 2025 09:53
@ericallam
ericallam merged commit c021d1d into main Dec 9, 2025
28 of 29 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ericallam
ericallam deleted the fix/dev-cli-max-listeners-exceeded branch December 9, 2025 09:54
@github-actions github-actions Bot mentioned this pull request Dec 9, 2025
chore: release v4.3.0 #2770
Merged
myftija pushed a commit that referenced this pull request Dec 12, 2025
@github-actions
chore: release v4.3.0 (#2770)
7d34817
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## [email protected]

### Minor Changes

- feat(cli): deterministic image builds for deployments
([#2778](#2778))
- feat(cli): enable zstd compression for deployment images
([#2773](#2773))

### Patch Changes

- The new `triggeredVia` field is now populated in deployments via the
CLI. ([#2767](#2767))
- fix(dev): stop max listeners exceeded warning messages when running
more than 10 runs concurrently
([#2771](#2771))
- Upgrade @modelcontextprotocol/sdk to 1.24.3
([#2768](#2768))
-   Updated dependencies:
    -   `@trigger.dev/[email protected]`
    -   `@trigger.dev/[email protected]`
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Minor Changes

- feat(cli): deterministic image builds for deployments
([#2778](#2778))

### Patch Changes

- The new `triggeredVia` field is now populated in deployments via the
CLI. ([#2767](#2767))

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`
    -   `@trigger.dev/[email protected]`
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
0ski pushed a commit that referenced this pull request Dec 16, 2025
@github-actions @0ski
chore: release v4.3.0 (#2770)
f028f26
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## [email protected]

### Minor Changes

- feat(cli): deterministic image builds for deployments
([#2778](#2778))
- feat(cli): enable zstd compression for deployment images
([#2773](#2773))

### Patch Changes

- The new `triggeredVia` field is now populated in deployments via the
CLI. ([#2767](#2767))
- fix(dev): stop max listeners exceeded warning messages when running
more than 10 runs concurrently
([#2771](#2771))
- Upgrade @modelcontextprotocol/sdk to 1.24.3
([#2768](#2768))
-   Updated dependencies:
    -   `@trigger.dev/[email protected]`
    -   `@trigger.dev/[email protected]`
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Minor Changes

- feat(cli): deterministic image builds for deployments
([#2778](#2778))

### Patch Changes

- The new `triggeredVia` field is now populated in deployments via the
CLI. ([#2767](#2767))

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`
    -   `@trigger.dev/[email protected]`
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

## @trigger.dev/[email protected]

### Patch Changes

-   Updated dependencies:
    -   `@trigger.dev/[email protected]`

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@matt-aitken matt-aitken matt-aitken approved these changes
@nicktrn nicktrn nicktrn approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ericallam @matt-aitken @nicktrn
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.