Repository navigation
Conversation
Signed-off-by: Su Yang <soulteary@users.noreply.github.com> (cherry picked from commit b3f6b21)
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.
Temporary dpkg contention from another package installation currently makes the installer's APT package installations fail immediately. This change gives the prerequisite and Engine installation commands a fixed, bounded 60-second wait; contention that outlasts the timeout still fails.
- What I did
-o DPkg::Lock::Timeout=60to the two executed APT installation commands ininstall.sh: prerequisites and Docker Engine packages.uidmapandiptables.The production change is limited to those four installation command strings. Both
command -v apt-getavailability checks and bothapt-get updatecommands remain unchanged. Package selection,-y,-qq, and the existing--allow-downgradesbehavior are preserved.- How I did it
The change uses APT's existing dpkg lock-acquisition timeout, without adding a retry loop. APT introduced this capability in 1.9.11; older APT versions do not provide this waiting behavior. The 60-second setting bounds waiting for the dpkg frontend and administration locks, rather than the duration of the complete package installation.
DPkg::Lock::Timeoutdoes not cover the/var/lib/apt/lists/lockused byapt-get update. The update commands retain their existing behavior, and the live suite includes a negative check for this limitation. See the APT lists-lock report.This revised implementation builds on the proposal by oreze in docker/docker-install#431, keeping APT runtime options out of executable-availability checks and update commands.
The upstream candidate is based on the
mastersnapshot2b32480025b223ebfddae9a3a8bef09027680f53. Candidate commit47854e0b70801b61127fabf8e3e27e0ca8050353records its cherry-pick provenance from implementation commitb3f6b21e17e44c4c64d692881bac706b35596ad2, and carries the DCO sign-off:- How to verify it
Run the offline and static checks:
The offline suite executes captured installer control flow using Ubuntu and Debian fixtures. It checks unpinned installations,
--version 27.5and its--allow-downgradesflag, both prerequisite and Engine installation commands, repository-only mode, unchanged update commands, and rootless APT availability/dependency instructions. Package-manager, download, privilege, and service commands are guarded against accidental execution during these checks.The before-change regression control used fork commit
c57bd8230308fc38ec5d199db5c7b95eac35d9c7. The final regression suite rejects that control for the missing installation lock-timeout options; the revised implementation passes. This fork regression-control snapshot is separate from the upstreammastercandidate base identified above.Run real lock tests only in an explicitly opted-in disposable container:
The final test script was completely exercised locally in these official containers:
ubuntu:24.04: APT 2.8.3, amd64; held-lock timeout measured 60.2 seconds.debian:12-slim: APT 2.6.1, arm64; held-lock timeout measured 60.0 seconds.Both final runs verified:
apt-get updatefail immediately, even when the dpkg timeout option is supplied.The live suite uses Python
fcntlrecord locks. It obtains the installedbashversion withdpkg-query, pins that exact version, and disables downloads. It never deletes lock files. Python is installed only while preparing the disposable test containers; these checks do not install Docker, validate Docker package dependencies, or verify daemon/service startup.Local shell syntax, ShellCheck, Python syntax, CI YAML structure, and
git diff --checkpassed. The dedicated candidate CI matrix also passed in the fork candidate CI run forubuntu:22.04,ubuntu:24.04, anddebian:12-slim. Those fork-side results are prior candidate validation; they are not presented as results from this newly opened upstream PR's CI run.- Description for the changelog
Wait up to 60 seconds for dpkg locks during APT package installation.