Skip to content

Conversation

@FrozenPandaz
Copy link
Collaborator

Current Behavior

Nx processes do not exit when their child tasks are exit with SIGINT

Expected Behavior

Nx processes do exit when their child tasks are exit with SIGINT

Related Issue(s)

Fixes #

@FrozenPandaz FrozenPandaz requested a review from a team as a code owner May 16, 2025 19:30
@FrozenPandaz FrozenPandaz requested a review from MaxKless May 16, 2025 19:30
@vercel
Copy link

vercel bot commented May 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview May 16, 2025 7:36pm

@nx-cloud
Copy link
Contributor

nx-cloud bot commented May 16, 2025

View your CI Pipeline Execution ↗ for commit b708623.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 46m 24s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 18s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 2s View ↗
nx documentation ✅ Succeeded 1m 52s View ↗

☁️ Nx Cloud last updated this comment at 2025-05-16 20:29:39 UTC

@FrozenPandaz FrozenPandaz requested a review from Copilot May 16, 2025 19:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request fixes an issue where Nx processes were not being cleaned up after their child tasks exited with SIGINT. The changes introduce a global cleanup handler in running-tasks.ts to ensure that all registered cleanup functions are executed when the process exits and remove the now-unneeded tuiEnabled flag from SeriallyRunningTasks in run-commands.impl.ts.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/nx/src/executors/run-commands/running-tasks.ts Adds a global cleanupFns array and registers cleanup functions to kill processes on exit
packages/nx/src/executors/run-commands/run-commands.impl.ts Removes the tuiEnabled flag and redundant isTuiEnabled import

RunCommandsCommandOptions,
} from './run-commands.impl';

const cleanupFns = [];
Copy link

Copilot AI May 16, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding an explicit type annotation for cleanupFns (e.g. Array<() => void>) to improve code clarity and maintainability.

Suggested change
const cleanupFns = [];
const cleanupFns: Array<() => void> = [];

Copilot uses AI. Check for mistakes.
@FrozenPandaz FrozenPandaz marked this pull request as draft May 16, 2025 20:31
@github-actions
Copy link
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 May 24, 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.

3 participants