Skip to content

Use apt lock timeout for prerequisites - #5296

Open
lewing wants to merge 1 commit into
mainfrom
lewing-fix-apt-lock-timeout
Open

Use apt lock timeout for prerequisites#5296
lewing wants to merge 1 commit into
mainfrom
lewing-fix-apt-lock-timeout

Conversation

@lewing

@lewing lewing commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

  • apply DPkg::Lock::Timeout=120 to every generated Debian-family apt and apt-get prerequisite command
  • replace one-time fuser polling with per-command native apt lock acquisition, eliminating the check/use race between package operations
  • cover generic internal-Linux, Mono WASM, and CoreCLR WASM command generation with focused tests

The 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.py
  • PYTHONPATH=.:scripts python3 -m py_compile scripts/run_performance_job.py scripts/tests/test_run_performance_job.py
  • git diff --check

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>
Copilot AI lite review requested due to automatic review settings September 1, 2026 23:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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=120 into generated apt/apt-get prerequisite commands.
  • Remove fuser-based dpkg lock polling from prerequisite generation and switch affected commands to apt_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.

@lewing

lewing commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

I hit this again in dotnet/runtime#133040

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