summaryrefslogtreecommitdiff
path: root/src/lib/config.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-27 11:05:50 +0300
committerPaul Buetow <paul@buetow.org>2026-06-27 11:05:50 +0300
commit9b16b1bc54213c7349ec9a44ba258466718c0f48 (patch)
treecba419df08735b3e157d325b5e8dd5a0a780dbec /src/lib/config.source.sh
parent1d6a00fd71cb8ea093da2f217f1724f4d5df1c85 (diff)
qr0: timeout + per-destination isolation for rsync sync_dist
Wrap each rsync in sync_dist in run_with_timeout (new SYNC_TIMEOUT config, default 300s) so a hung or unreachable mirror cannot block the whole sync, matching every other external call. Make destinations isolated: under set -euo pipefail a single failing destination used to abort the loop and silently skip the rest. Now each destination runs under a localized set +e (the project's refresh_splash idiom), results are collected per destination, a clear pass/fail summary is logged, and sync returns non-zero if any destination failed while still attempting all of them. SYNC_TIMEOUT is plumbed like TAR_TIMEOUT: shuriken.default.conf, apply_config_defaults, print_config, verbose config log, and positive-integer validation in both validate_config (generate path) and validate_sync_config (sync path). No CLI flag, matching TAR_TIMEOUT. Tests: a sync where one destination fails still attempts the others and exits non-zero with the summary; SYNC_TIMEOUT=0 is rejected as a positive integer. Adds install_rsync_spy_failing_one helper and updates the print_config expected blocks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/config.source.sh')
-rw-r--r--src/lib/config.source.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/config.source.sh b/src/lib/config.source.sh
index 9dd48ee..caa2fe3 100644
--- a/src/lib/config.source.sh
+++ b/src/lib/config.source.sh
@@ -52,6 +52,10 @@ apply_config_defaults() {
THUMB_SUBDIVIDE_PERCENT="${THUMB_SUBDIVIDE_PERCENT:-30}"
THUMB_FEATURE_PERCENT="${THUMB_FEATURE_PERCENT:-10}"
SYNC_DELETE="${SYNC_DELETE:-yes}"
+ # Per-destination rsync timeout (seconds), mirroring TAR_TIMEOUT/
+ # IMAGEMAGICK_TIMEOUT. Each destination in sync_dist is wrapped in
+ # run_with_timeout so a hung/unreachable mirror cannot block the whole sync.
+ SYNC_TIMEOUT="${SYNC_TIMEOUT:-300}"
# Default 'yes': a tarball of the incoming dir is included in the dist unless
# disabled. This must match the documented default in shuriken.default.conf
# (TARBALL_INCLUDE=yes) -- it previously drifted to 'no' here. 'yes' is the