From 9b16b1bc54213c7349ec9a44ba258466718c0f48 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 27 Jun 2026 11:05:50 +0300 Subject: 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 --- src/lib/config.source.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/config.source.sh') 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 -- cgit v1.2.3