Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rdk/timesyncd-conf-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ output=""
count=0
LOG_FILE="/opt/logs/ntp.log"
attempts=1
max_attempts=5
max_attempts=40

Comment on lines +29 to 30
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raising max_attempts to 40 increases the worst-case wait before fallback to ~117 seconds (39 * 3s sleeps). If this script is run during boot via systemd, that longer blocking period can delay startup and may exceed the calling unit’s timeout; consider making this value configurable (e.g., via env var) or expressing it as a max-wait duration to keep timing explicit.

Suggested change
max_attempts=40
# Keep the retry timing explicit and configurable for systemd-managed startup.
# Defaults preserve the previous behaviour: 39 sleeps * 3 seconds ~= 117 seconds,
# which corresponds to 40 total attempts including the initial try.
retry_sleep_seconds="${TIMESYNCD_CONF_UPDATE_RETRY_SLEEP_SECONDS:-3}"
max_wait_seconds="${TIMESYNCD_CONF_UPDATE_MAX_WAIT_SECONDS:-117}"
case "$retry_sleep_seconds" in
''|*[!0-9]*|0)
retry_sleep_seconds=3
;;
esac
case "$max_wait_seconds" in
''|*[!0-9]*)
max_wait_seconds=117
;;
esac
max_attempts=$((max_wait_seconds / retry_sleep_seconds + 1))

Copilot uses AI. Check for mistakes.
if [ -f /etc/env_setup.sh ]; then
. /etc/env_setup.sh
Expand Down
Loading