Skip to content

Fix external repo resolver process cleanup#317

Merged
tinder-maxwellelliott merged 4 commits intoTinder:masterfrom
sharmila-oai:sharmila/eacc-1335-external-repo-resolver
Mar 10, 2026
Merged

Fix external repo resolver process cleanup#317
tinder-maxwellelliott merged 4 commits intoTinder:masterfrom
sharmila-oai:sharmila/eacc-1335-external-repo-resolver

Conversation

@sharmila-oai
Copy link
Contributor

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

@sharmila-oai
Copy link
Contributor Author

@tinder-maxwellelliott this one too 🙏

Copy link
Collaborator

@tinder-maxwellelliott tinder-maxwellelliott left a comment

Choose a reason for hiding this comment

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

Thanks!

@tinder-maxwellelliott tinder-maxwellelliott merged commit 618666b into Tinder:master Mar 10, 2026
15 checks passed
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.

2 participants