Set an explicit timeout in updater checks. (#14273)
If it takes more than an hour to run the updater, something has gone horribly wrong, so just kill it instead of letting it keep running.
Austin S. Hemmelgarn committed
Jan 16, 2023 at 11:05 UTC
c8ddde8df2416282fc3514d7a69b82f14be1a69e
1 file changed
+7
-1
.github/scripts/run-updater-check.sh
+7
-1
@@ -12,7 +12,13 @@ netdata -W buildinfo
12
echo "::endgroup::"
13
echo ">>> Updating Netdata..."
14
export NETDATA_BASE_URL="http://localhost:8080/artifacts/" # Pull the tarball from the local web server.
15
-/netdata/packaging/installer/netdata-updater.sh --not-running-from-cron --no-updater-self-update || exit 1
15
+timeout 3600 /netdata/packaging/installer/netdata-updater.sh --not-running-from-cron --no-updater-self-update
16
+
17
+case "$?" in
18
+ 124) echo "!!! Updater timed out." ; exit 1 ;;
19
+ 0) ;;
20
+ *) echo "!!! Updater failed." ; exit 1 ;;
21
+esac
22
echo "::group::>>> Post-Update Environment File Contents"
23
cat /etc/netdata/.environment
24
echo "::endgroup::"