Skip to content

fix(core): set max listeners for process in task orchestrator#33596

Merged
leosvelperez merged 2 commits intonrwl:masterfrom
AshishShanker:fix/set-max-listeners-for-process
Dec 10, 2025
Merged

fix(core): set max listeners for process in task orchestrator#33596
leosvelperez merged 2 commits intonrwl:masterfrom
AshishShanker:fix/set-max-listeners-for-process

Conversation

@AshishShanker
Copy link
Copy Markdown
Contributor

When 8+ dependent tasks exist, each adds an exit listener to track completion. This listener attaches to process. So we apply the same fix that worked for stdout and stderr, and was merged through PR 16693

Current Behavior

For nx targets with 8+ dependent targets, we encounter maxListenersExceededWarning:

(node: 22553) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit.
(node: 22553) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit.
(node: 22553) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit.

Expected Behavior

No MaxListenersExceededWarning should be thrown on account of the nx run.

Related Issue(s)

Fixes #32439

When 8+ dependent tasks exist, each adds an `exit` listener to track completion. This listener attaches to `process`. So we apply the same fix that worked for `stdout` and `stderr`, and was merged through [PR 16693](nrwl#16993)
@AshishShanker AshishShanker requested a review from a team as a code owner November 24, 2025 16:59
@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 24, 2025

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 548da15

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Dec 10, 2025 9:27am

@AshishShanker AshishShanker changed the title fix: Set max listeners for process in task orchestrator fix(core): Set max listeners for process in task orchestrator Nov 24, 2025
@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Dec 10, 2025

View your CI Pipeline Execution ↗ for commit 548da15

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 16m 44s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 45s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 11s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-10 10:31:16 UTC

@leosvelperez leosvelperez changed the title fix(core): Set max listeners for process in task orchestrator fix(core): set max listeners for process in task orchestrator Dec 10, 2025
nx-cloud[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

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

Important

A new CI pipeline execution was requested that may update the conclusion below...

Nx Cloud has identified a possible root cause for your failed CI:

Our test failures in the Storybook e2e tests appear to be environment-related rather than caused by the listener limit changes in this PR. The Storybook dev server processes are being killed during startup (showing "Killed" messages and timeouts), but the PR only adjusts max listeners to prevent warnings - it wouldn't cause process termination. These failures likely indicate resource constraints in the CI environment affecting long-running e2e tests.

No code changes were suggested for this issue.

If the issue was transient, you can trigger a rerun by pushing an empty commit:

git commit --allow-empty -m "chore: trigger rerun"
git push

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

Copy link
Copy Markdown
Member

@leosvelperez leosvelperez left a comment

Choose a reason for hiding this comment

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

Thanks for contributing!

@leosvelperez leosvelperez merged commit cc369a3 into nrwl:master Dec 10, 2025
12 of 14 checks passed
FrozenPandaz pushed a commit that referenced this pull request Dec 15, 2025
When 8+ dependent tasks exist, each adds an `exit` listener to track
completion. This listener attaches to `process`. So we apply the same
fix that worked for `stdout` and `stderr`, and was merged through [PR
16693](#16993)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
For `nx` targets with 8+ dependent targets, we encounter
`maxListenersExceededWarning`:
```
(node: 22553) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit.
(node: 22553) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit.
(node: 22553) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGHUP listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit.
```
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
No `MaxListenersExceededWarning` should be thrown on account of the nx
run.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #32439

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running inferred tasks using run-many or affected causes (node:4192) MaxListenersExceededWarning

2 participants