Skip to content

launcher: sweep temp files of dead pids before copying dx (part of #6207) - #6419

Merged
TrapsterDK merged 1 commit into
mainfrom
fix-6207-launcher-temp-leak
Nov 4, 2026
Merged

TrapsterDK merged 1 commit into
mainfrom
fix-6207-launcher-temp-leak

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Part of #6207

A tools/dx run that is SIGKILLed skips its trap, so dx.<pid>, built.<pid> and inputs.<pid> stay in .dx/launcher for good.

Change

  • tools/dx: sync_copy first removes dx.N, built.N and inputs.N whose pid no longer answers kill -0. Live runs, including the current one, are kept.
  • tools/dx_launcher_test.sh: before the launcher runs, creates dx.999999 and built.999999 (dead pid) and dx.$$ (live pid). Asserts the dead ones are gone and the live one stays.

Remaining

  • tools/dx.cmd has the same leak (built.<guid>, query.<guid>). Its tags are GUIDs, not pids, so the liveness check needs a different tag scheme. Not done here. Windows only.
  • Windows and macOS are not exercised; Linux only.

Testing

  • Launcher test run directly against the old and new tools/dx: the new test fails on the old launcher (the launcher kept dx.999999 from a dead pid) and passes on the new one.
  • tools/dx test //tools:dx_launcher_test: passed.
  • tools/dx check --apply //tools:all: failed in the generate phase on unrelated fixtures under tools/docs (Pester, mylib, vue fixtures). Format, lint and typecheck were skipped. shellcheck was not run.
  • Not run: nested-Bazel and *_consumer_test targets (CI runs them).

🤖 Generated with Claude Code

Assisted by Claude.

A run SIGKILLed during the copy skips its trap, so dx.<pid>, built.<pid>
and inputs.<pid> stayed in .dx/launcher for good. sync_copy now removes
those whose pid no longer answers kill -0. The launcher test covers a dead
and a live pid.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011u9TXHDZrfmzFQ2WT8QAKK
@TrapsterDK
TrapsterDK force-pushed the fix-6207-launcher-temp-leak branch from af4f24a to 0812e9b Compare November 4, 2026 20:32
@TrapsterDK
TrapsterDK merged commit 6505a94 into main Nov 4, 2026
@TrapsterDK
TrapsterDK deleted the fix-6207-launcher-temp-leak branch November 4, 2026 20:32
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.

1 participant