Skip to content

Commit

Permalink
Add a slave container configuration timeout
Browse files Browse the repository at this point in the history
This should fix the following issue.
When a JobDSL seed job is executed while a container is waiting for its
configuration YAD plugin may loose track of the container.
The container is left behind indefinitely waiting for its configuration.

With this change, the container eventually exit in error and the jenkins
master is able to provision another container.
  • Loading branch information
ndessart committed Apr 5, 2019
1 parent 2fc3c6d commit fade58d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

set -uxe

config_timeout=60
export CONFIG="/tmp/config.sh"
while [ ! -f "$CONFIG" ]; do
config_timeout=$(($config_timeout-1))
if [ $config_timeout -le 0 ]; then
echo "No config file found after 60s! Exiting."
exit 1
fi
echo "No config, sleeping for 1 second"
sleep 1
done
Expand Down

0 comments on commit fade58d

Please sign in to comment.