Skip to content

fix(tasks): reuse running process manager for process deps - #3152

Open
Arshgill01 wants to merge 1 commit into
cachix:mainfrom
Arshgill01:cursor/fix-tasks-process-deps-b815
Open

Arshgill01 wants to merge 1 commit into
cachix:mainfrom
Arshgill01:cursor/fix-tasks-process-deps-b815

Conversation

@Arshgill01

Copy link
Copy Markdown
Contributor

Fixes #3137.

devenv tasks run started devenv:processes:* dependencies in a fresh local runner even when those processes were already healthy under devenv up. That second copy crash-looped services such as PostgreSQL (initdb as root).

When a process manager is already running, tasks run now:

  1. Collects the process names the task graph would schedule
  2. Asks the native manager to start only missing names (Start / start_with_deps skips Ready/Starting/Waiting)
  3. Waits until those processes are ready
  4. Sets ignore_process_deps so the local runner does not launch them again
  5. Does not stop_all on exit, so the existing manager keeps ownership

If no manager is running, behavior is unchanged: process deps start locally and are stopped when the task graph finishes.

Test plan

  • cargo test -p devenv-tasks --lib scheduled_process_names
  • cargo fmt --all -- --check
  • Integration test tests/tasks-run-attach-running (devenv up -d then devenv tasks run test:repro must keep the dummy process pid and starts == 1)
  • Manual: with services.postgres.enable = true and after = ["devenv:processes:postgres"], run devenv up -d; devenv tasks run test:repro without a postgres crash loop

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🔍 Suggested Reviewers

Based on git blame analysis of the changed lines, the following contributors have significant experience with the modified code:

Please consider reviewing this PR as you have authored significant portions of the code being modified. Your expertise would be valuable! 🙏

This comment was automatically generated by git-blame-auto-reviewer

Last updated: 2026-09-14T04:35:45.926Z

@Arshgill01
Arshgill01 marked this pull request as ready for review September 3, 2026 04:04
@cursor
cursor Bot force-pushed the cursor/fix-tasks-process-deps-b815 branch 3 times, most recently from 2e095b4 to cdf7fc7 Compare September 7, 2026 04:44
@Arshgill01

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (includes #3146 and #3135). CHANGELOG keeps this PR’s #3137 entry plus main’s newer entries. behind_by 0, mergeable.

@cursor
cursor Bot force-pushed the cursor/fix-tasks-process-deps-b815 branch 2 times, most recently from d7b3766 to 4ae8f6d Compare September 10, 2026 03:51
devenv tasks run used to start devenv:processes:* dependencies in a
fresh local runner even when devenv up already had a manager. That
crash-looped healthy services such as postgres.

When a manager is already running, attach to it, start only missing
process deps, wait until they are ready, and skip launching or stopping
those processes in the local runner.

Fixes cachix#3137

Co-authored-by: Arshdeep singh <arshgill6120@gmail.com>
@cursor
cursor Bot force-pushed the cursor/fix-tasks-process-deps-b815 branch from 4ae8f6d to f1f9546 Compare September 14, 2026 04:35
@Arshgill01

Copy link
Copy Markdown
Contributor Author

Rebased this branch onto latest cachix/devenv main (6e830506). Conflicts were in CHANGELOG (moved the #3137 entry under 2.3.2 unreleased, kept newer main entries) and docs/src/content/docs/tasks.mdx (docs were converted from .md). Same head branch; no new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tasks starts processes even when they are already running

2 participants