apt-get calls don't set DPkg::Lock::Timeout, fail immediately on dpkg lock contention
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
Hướng nghiên cứu
Kiểm tra mọi lệnh gọi apt-get trong script cài đặt, bao gồm cả vòng lặp thử lại APT_DEPS tại L1533-L1560. Thêm nhất quán tùy chọn DPkg::Lock::Timeout được đề xuất, đồng thời giữ nguyên hành vi hiện có của Acquire::Retries. Hoàn tất khi apt-get chờ trong trường hợp tranh chấp khóa dpkg thay vì thất bại ngay lập tức.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Title
apt-get calls don't set DPkg::Lock::Timeout, fail immediately on dpkg lock contention
Description
None of the script's apt-get calls set DPkg::Lock::Timeout, so any of them fail immediately if another process holds the dpkg lock (e.g. cloud-init running a concurrent apt-get on first boot):
Installing package(s): datadog-agent datadog-signing-keys
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2332 (apt-get)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
ERROR
Failed to install one or more packages...
Acquire::Retries, used on the install calls, only retries failed downloads, not lock acquisition. apt has a built-in flag for this: -o DPkg::Lock::Timeout=<seconds> makes apt poll for the lock instead of failing immediately.
Suggested fix
Add -o DPkg::Lock::Timeout='<n>' to every apt-get call in the script.
Potential Improvement
If/when support for earlier versions of apt is dropped, the APT_DEPS retry loop (L1533-1560) could be removed in favor of DPkg::Lock::Timeout, which is silently ignored on older apt:
$sudo_cmd apt-get update -o DPkg::Lock::Timeout="60"
$sudo_cmd DEBIAN_FRONTEND=noninteractive apt-get install -o Acquire::Retries="5" -o DPkg::Lock::Timeout="60" -y "${APT_DEPS[@]}"
- Ngôn ngữ chính
- Shell
- Star
- 17
- Fork
- 14
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 7
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DataDog/agent-linux-install-script
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 52/100
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
DataDog/agent-linux-install-script#354 · 1 bình luận · 1 reaction ·
Tất cả issue của DataDog/agent-linux-install-script
Issue tương tự
-
align on terminology Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CycloneDX/transparency-exchange-api#393 · 1 bình luận ·
-
module/agent platform/macos type/bug/regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
CachyOS/cachyos-aur-derived#754 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
CrowdStrike/falcon-scripts#528 ·
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100