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.validate.source.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/lib/config.validate.source.sh') diff --git a/src/lib/config.validate.source.sh b/src/lib/config.validate.source.sh index 7b1421b..f0b14bf 100644 --- a/src/lib/config.validate.source.sh +++ b/src/lib/config.validate.source.sh @@ -291,6 +291,7 @@ validate_common_config() { validate_positive_integer_config_var IMAGE_JOBS || return validate_positive_integer_config_var IMAGEMAGICK_TIMEOUT || return validate_positive_integer_config_var TAR_TIMEOUT || return + validate_positive_integer_config_var SYNC_TIMEOUT || return validate_yes_no_config_var SHUFFLE || return validate_yes_no_config_var SPLASH_PAGE || return validate_yes_no_config_var STATS_PAGE || return @@ -366,6 +367,11 @@ validate_rsync() { validate_sync_config() { require_config_var DIST_DIR || return validate_yes_no_config_var SYNC_DELETE || return + # SYNC_TIMEOUT bounds each per-destination rsync in sync_dist, so it must be + # a positive integer on the sync path too (the generate path validates it via + # validate_config). Without this, a bogus value would only surface as a + # confusing "timeout: invalid time interval" at run time. + validate_positive_integer_config_var SYNC_TIMEOUT || return validate_sync_destinations || return if [[ ! -d "$DIST_DIR" || ! -r "$DIST_DIR" || ! -x "$DIST_DIR" ]]; then -- cgit v1.2.3