Skip to content

fix(core): keep continuous children alive when nx:noop orchestrator completes#35388

Merged
AgentEnder merged 1 commit intomasterfrom
tasty-pickle
Apr 28, 2026
Merged

fix(core): keep continuous children alive when nx:noop orchestrator completes#35388
AgentEnder merged 1 commit intomasterfrom
tasty-pickle

Conversation

@AgentEnder
Copy link
Copy Markdown
Member

Current Behavior

A target with executor: nx:noop and dependsOn pointing at continuous tasks is unusable as a top-level orchestrator.

Given a config like:

"dev": {
  "executor": "nx:noop",
  "dependsOn": ["serve", "watch-css"]
}

where serve and watch-css are continuous, running nx run app:dev:

  1. serve and watch-css start and become ready.
  2. The nx:noop fast-path (task-orchestrator.ts:1128) exits dev instantly with success.
  3. cleanUpUnneededContinuousTasks (task-orchestrator.ts:1785-1809) runs on every completion. Its predicate keeps a continuous task alive only if it's in initializingTaskIds and still incomplete, OR it's a continuousDependencies entry of some incomplete task.
  4. The only initiating task (dev) just completed, and the continuous children aren't directly in initializingTaskIds — they're only deps of the now-complete noop.
  5. Both continuous children get SIGKILL'd immediately.

Expected Behavior

Running a top-level nx:noop orchestrator should keep its continuous dependsOn children alive. The orchestrator process stays running until the continuous children exit (e.g. user Ctrl+C), matching the ergonomics of nx run-many -t serve,watch-css.

Fix

Expand initializingTaskIds inside the orchestrator through nx:noop tasks when seeding the keep-alive anchor set. The real tasks beneath a noop become the anchors so they survive the noop's instant completion.

  • New helper expandInitiatingTasksThroughNoop in packages/nx/src/tasks-runner/utils.ts: BFS that drops any nx:noop from the anchor set and enqueues its dependencies + continuousDependencies, recursing through nested noops; cycle-safe via a visited set.
  • Wire it into TaskOrchestrator.initializingTaskIds at task-orchestrator.ts:101.
  • The public initiatingTasks array is left untouched, so TUI output (tui-summary-life-cycle.ts), atomized e2e-ci coordinator semantics, hashing, and caching are unchanged. For atomized chunk patterns the expansion has no visible effect because children aren't continuous.

Related Issue(s)

Fixes #

…ompletes

A target with `executor: nx:noop` and `dependsOn` pointing at continuous
tasks was unusable as a top-level orchestrator: the noop fast-path exits
instantly, `cleanUpUnneededContinuousTasks` then sees no incomplete task
needing the continuous children, and SIGKILLs them.

Expand initiating task ids through `nx:noop` tasks when seeding the
orchestrator's keep-alive anchor set so the real tasks beneath a noop
become the anchors. Preserves `initiatingTasks` itself, so TUI output,
atomized `e2e-ci` coordinator semantics, hashing, and caching are
unchanged.

- Add `expandInitiatingTasksThroughNoop` helper in tasks-runner/utils
- Wire it into `TaskOrchestrator.initializingTaskIds`
- Cover passthrough, continuous/non-continuous expansion, nested noops,
  empty-deps, cycles, and mixed initiators
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 22, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit d4551bd
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69e90ee281a3990008581a05
😎 Deploy Preview https://deploy-preview-35388--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 22, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit d4551bd
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69e90ee2c48c19000887f086
😎 Deploy Preview https://deploy-preview-35388--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Apr 22, 2026

View your CI Pipeline Execution ↗ for commit d4551bd

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 52m 15s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 17s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 24s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 7s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-22 19:05:31 UTC

@AgentEnder AgentEnder marked this pull request as ready for review April 23, 2026 03:44
@AgentEnder AgentEnder requested a review from a team as a code owner April 23, 2026 03:44
@AgentEnder AgentEnder requested a review from MaxKless April 23, 2026 03:44
@FrozenPandaz FrozenPandaz self-requested a review April 23, 2026 17:40
@FrozenPandaz FrozenPandaz added the priority: high High Priority (important issues which affect many people severely) label Apr 23, 2026
taskGraph: TaskGraph,
projectGraph: ProjectGraph
): Set<string> {
const expanded = new Set<string>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe we have a util for this somewhere.

@FrozenPandaz FrozenPandaz changed the base branch from master to next April 23, 2026 18:56
@FrozenPandaz FrozenPandaz force-pushed the next branch 2 times, most recently from 58cb2a7 to 33b38bf Compare April 23, 2026 22:00
Base automatically changed from next to master April 24, 2026 18:55
@AgentEnder AgentEnder merged commit 096a49d into master Apr 28, 2026
26 checks passed
@AgentEnder AgentEnder deleted the tasty-pickle branch April 28, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: high High Priority (important issues which affect many people severely)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants