nx run-many waits 10 minutes before exiting
Current Behavior
When running nx run-many as part of building a docker image on gitlab, nx waits for 10 minutes before exiting.
RUN pnpm nx run-many -t build -p $AFFECTED_PACKAGES && pnpm nx run-many -t test:compiled -p $AFFECTED_PACKAGES
The time between the final NX success message and the process ending is always exactly 600s/10 minutes (see screenshot).
Enabling perf logs does not yield any more insights
I bisected the versions and it looks like this behavior was introduced in 19.8.11 presumably by core: shutdown plugin workers when disconnected but it could also have been a different change.
Setting CI=1 fixes this issue, but I wanted to report this nonetheless as other people may be impacted by it as well.
I haven't been able to reproduce this locally and I haven't been able to create a reproduction repo. Let me know if that is needed and I can dedicate some time to it.
Thank you
Expected Behavior
nx run-many exits immediately
GitHub Repo
No response
Steps to Reproduce
None
Nx Report
Node : 22.14.0
OS : linux-x64
Native Target : x86_64-linux
pnpm : 10.8.1
nx : 19.8.11
@nx/js : 19.8.11
@nx/jest : 19.8.11
@nx/linter : 19.8.11
@nx/eslint : 19.8.11
@nx/workspace : 19.8.11
@nx/devkit : 19.8.11
@nx/plugin : 19.8.11
@nrwl/tao : 19.8.11
typescript : 5.8.3
---------------------------------------
Failure Logs
Package Manager Version
No response
Operating System
- [ ] macOS
- [x] Linux
- [ ] Windows
- [ ] Other (Please specify)
Additional Information
No response
Could you please retry with the latest version and see if the issue still persists? We've done a lot of fixes in this area and believe it should be resolved.
Sorry, I didn't make this clear in the description. This is also/still happening with the latest version (21.0.3).
I just did more debugging on this and noticed the following:
The 10 minute wait is only happening when I chain two nx run-many commands using the logical chaining operator (&&), e.g. RUN pnpm nx run-many -t build -p $AFFECTED_PACKAGES && pnpm nx run-many -t test:compiled -p $AFFECTED_PACKAGES.
Even stranger, it only happens for some of the tasks. Here is a list of task combinations that fails and one that works. The dummy task is a task that prints out the pnpm version, build is a standard ts build, lint runs eslint and test:compiled runs jest.
Fails build && test:compiled build && lint build && dummy lint && build lint && dummy
Works lint build dummy && build dummy && lint dummy && dummy
Not entirely sure what to make of this yet, but maybe it helps to further narrow this down.
This issue has been automatically marked as stale because no results of retrying on the latest version of Nx was provided within 7 days. It will be closed in 21 days if no results are provided. If the issue is still present, please reply to keep it active. If the issue was not present, please close this issue. Thanks for being a part of the Nx community! 🙏
I did try it on the latest (see my comment above).
This issue has been automatically marked as stale because no results of retrying on the latest version of Nx was provided within 7 days. It will be closed in 21 days if no results are provided. If the issue is still present, please reply to keep it active. If the issue was not present, please close this issue. Thanks for being a part of the Nx community! 🙏
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.