diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-25 16:04:15 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-25 16:04:15 -0400 |
| commit | 05ec096cb2dcab3e1bde6081d1ddb9028b501afd (patch) | |
| tree | 2a8fe4cb5c3bab116ceada7af9e2660c5b0e2b2d | |
| parent | 66caeb5ca7dbe497fa40c5a5d321548f7a879b27 (diff) | |
| download | archsetup-05ec096cb2dcab3e1bde6081d1ddb9028b501afd.tar.gz archsetup-05ec096cb2dcab3e1bde6081d1ddb9028b501afd.zip | |
fix(archsetup): run reflector during install to avoid mirror stalls
The base image ships the full unsorted worldwide mirrorlist (hundreds of mirrors), and archsetup only configured reflector's timer, so the install ran every download against that list. pacman then stalled for many minutes on a slow or unresponsive mirror during the package installs. archsetup now runs reflector once before the heavy installs, curating a few fast recently-synced HTTPS mirrors and refreshing the databases against them. The run is bounded by `timeout` and non-fatal, so a flaky mirror-status service falls back to the base list instead of blocking the install.
Surfaced by the ZFS VM test path, where a worldwide-list mirror stalled a full run at the ditaa/JRE download.
| -rwxr-xr-x | archsetup | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -990,6 +990,21 @@ prerequisites() { --save /etc/pacman.d/mirrorlist EOF + # Run reflector now, not only on the timer. The base image ships the full + # unsorted worldwide mirrorlist (hundreds of mirrors), so the heavy package + # installs below can stall for many minutes on a slow or unresponsive one. + # Curate to a few fast, recently-synced HTTPS mirrors up front, then refresh + # the databases against them. Bounded by `timeout` and non-fatal: reflector's + # own per-probe timeouts cap it, and the base list still works if it can't + # finish, so a flaky mirror-status service never blocks the install. + action="selecting fast mirrors (reflector)" && display "task" "$action" + backup_system_file /etc/pacman.d/mirrorlist + if timeout 120 reflector @/etc/xdg/reflector/reflector.conf >> "$logfile" 2>&1; then + pacman -Syy >> "$logfile" 2>&1 || error_warn "refreshing databases after reflector" "$?" + else + error_warn "selecting fast mirrors (reflector)" "$?" + fi + action="enabling the reflector timer" && display "task" "$action" (systemctl enable reflector.timer >> "$logfile" 2>&1) || \ error_warn "$action" "$?" |
