Skip to content

Fix external repo resolver process cleanup#317

Open
sharmila-oai wants to merge 1 commit intoTinder:masterfrom
sharmila-oai:sharmila/eacc-1335-external-repo-resolver
Open

Fix external repo resolver process cleanup#317
sharmila-oai wants to merge 1 commit intoTinder:masterfrom
sharmila-oai:sharmila/eacc-1335-external-repo-resolver

Conversation

@sharmila-oai
Copy link

Why

When ExternalRepoResolver runs bazel query to resolve canonical bzlmod external repo paths, it reads only the first line and returns immediately. Without explicitly closing stdin/stderr and terminating the child process, the spawned Bazel query can continue running in the background. This can leak subprocesses and create avoidable resource pressure during fine-grained external repo hashing.

What changed
  • Updated runProcessAndCaptureFirstLine to:
    • discard stderr output
    • close process stdin immediately
    • read one stdout line and then always clean up the process
  • Added terminateProcess helper that:
    • attempts graceful termination (destroy)
    • escalates to force kill (destroyForcibly) if needed
Validation
  • bazel test //cli:SourceFileHasherTest
  • Previously validated with bazel test //cli:SourceFileHasherTest //cli:E2ETest for this exact patch

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