Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node emits MaxListenersExceededWarning with v9.0.0 #502

Closed
Urmeli0815 opened this issue Sep 9, 2024 · 4 comments · Fixed by #503
Closed

Node emits MaxListenersExceededWarning with v9.0.0 #502

Urmeli0815 opened this issue Sep 9, 2024 · 4 comments · Fixed by #503
Labels

Comments

@Urmeli0815
Copy link

After updating to v9.0.0 I get a MaxListenersExceededWarning warning when starting more than 10 tasks via concurrently. The callstack of the warning is:

Generate source code (12 tasks) ...
 0% | ETA: 0s | 0/12(node:14748) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListenert
    at [kNewListener] (node:internal/event_target:562:17)
    at [kNewListener] (node:internal/abort_controller:268:24)
    at AbortSignal.addEventListener (node:internal/event_target:675:23)
    at mycheckout\node_modules\rxjs\dist\cjs\internal\observable\fromEvent.js:38:111
    at Observable._subscribe (mycheckout\node_modules\rxjs\dist\cjs\internal\observable\fromEvent.js:61:9)
    at Observable._trySubscribe (mycheckout\node_modules\rxjs\dist\cjs\internal\Observable.js:41:25)
    at mycheckout\node_modules\rxjs\dist\cjs\internal\Observable.js:35:31
    at Object.errorContext (mycheckout\node_modules\rxjs\dist\cjs\internal\util\errorContext.js:22:9)
    at Observable.subscribe (mycheckout\node_modules\rxjs\dist\cjs\internal\Observable.js:26:24)
    at Object.mergeInternals (mycheckout\node_modules\rxjs\dist\cjs\internal\operators\mergeInternals.js:56:12)

In my case I start over 300 tasks (in the worst case) using concurrently. But the warning appears as soon as I have more than 10 tasks.

I also noticed that the exited property of these tasks never seems to be set, even when the task finished correctly. I display a progress bar and for the progress-update I count all tasks in the exited state.

@gustavohenke
Copy link
Member

Thanks. Created #503 to fix this.

@gustavohenke
Copy link
Member

Fix published in v9.0.1.

@Urmeli0815
Copy link
Author

I could verify that the fix is working.

One more thing: I still had the problem that the exited property of the command (https://github.com/open-cli-tools/concurrently/blob/main/src/command.ts#L162) never switches to true. I now use cmd.state == "exited" instead which works for me now.

@gustavohenke
Copy link
Member

lol, it's not set anywhere 🤦 , but yeah please use state.
Seems I missed adding #455 as a breaking change in the release notes of v9.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants