Use apt lock timeout for prerequisites - #5296
Open
lewing wants to merge 1 commit into
Open
Conversation
Apply apt's native bounded lock acquisition to every generated Debian-family package operation, eliminating the check/use race in the up-front fuser polling. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The updated prerequisite command generation applies the lock timeout consistently and is backed by targeted tests that validate both the new option and removal of lock polling.
Pull request overview
Updates Linux prerequisite command generation to rely on native apt/apt-get lock acquisition (via DPkg::Lock::Timeout) instead of external polling, reducing dpkg/apt lock race failures during Helix runs.
Changes:
- Introduce a shared
apt_command()helper that injects-o DPkg::Lock::Timeout=120into generatedapt/apt-getprerequisite commands. - Remove
fuser-based dpkg lock polling from prerequisite generation and switch affected commands toapt_command(...). - Add focused pytest coverage to ensure all generated apt commands include the lock timeout option and that dpkg lock polling is not emitted.
File summaries
| File | Description |
|---|---|
| scripts/run_performance_job.py | Adds apt_command() and updates prerequisite generation to consistently apply apt lock timeout and remove dpkg lock polling. |
| scripts/tests/test_run_performance_job.py | Adds tests validating apt lock timeout usage across relevant command-generation variants and absence of fuser polling. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Member
Author
|
I hit this again in dotnet/runtime#133040 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DPkg::Lock::Timeout=120to every generated Debian-familyaptandapt-getprerequisite commandfuserpolling with per-command native apt lock acquisition, eliminating the check/use race between package operationsThe race was observed in runtime-wasm-perf build 1577638 and previously in build 1569475. This is related to #5180 and dotnet/runtime#79117.
Testing
PYTHONPATH=.:scripts python3 -m pytest -q scripts/tests/test_run_performance_job.pyPYTHONPATH=.:scripts python3 -m py_compile scripts/run_performance_job.py scripts/tests/test_run_performance_job.pygit diff --check