Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reboot worker periodically #1744

Merged
merged 8 commits into from
Apr 16, 2024
Merged
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
9 changes: 9 additions & 0 deletions buildbot/start_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,17 @@ function is_worker_connected() {
)
}

function shutdown_maybe() {
[[ $(cat /proc/uptime | grep -oP "^\d+") -lt $((3600*72)) ]] && return
(w -h | wc -l) && return
while sudo pkill -SIGHUP buildbot-worker; do sleep 5; done;
shutdown now
sleep 1000
}

function get_worker_host() {
local WORKER_NAME="$1"
shutdown_maybe
(
set -o pipefail
curl ${API_URL}/${WORKER_NAME} \
Expand Down