Azure / Azure/azure-sdk-for-rust
Use a machine-wide semaphore to lock per-repo when ensuring correct test-proxy is installed
- Dominant language
- Rust
- Stars
- 884
- Forks
- 365
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 109
Description
When working on #1955 to resolve #1955, I noticed that [Go uses a file lock](https://github.com/Azure/azure-sdk-for-go/blob/5f7071b66c3745bea4b47054ba391825ea8f022e/sdk/internal/recording/server.go#L221-L248) - though, machine wide for what is otherwise store per-repo - when checking for the right version of test-proxy and during download and extract to avoid contention issues. However, `cargo test` - like `go test` - runs tests synchronously and sequentially, so this seems dubious.
I've opened this tracking issue to reference in code and we can consider later. But because files can pose problems if the test process dies (as noted in the Go code as well), I was considering used named pipes on Windows and FIFO pipes on "unix" (macOS and linux) instead.
Contributor guide
Research direction
Start with the test-proxy installation path referenced from #1955 and compare it with the Go file-lock implementation in server.go. Review how cargo test runs these checks, then evaluate the named-pipe and FIFO alternatives described here for machine-wide per-repository synchronization. Done should be a decided, documented locking approach that avoids contention and handles interrupted processes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, rust
- Domain
- build-system, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100