summaryrefslogtreecommitdiffstats
path: root/puppet/modules
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@digia.com>2014-06-26 09:11:38 +0300
committerSimo Fält <simo.falt@digia.com>2014-06-27 05:56:41 +0200
commitea94d95db8b76bcba4d11d1520345a9956f2b5be (patch)
treed49b4eae3e7064e17ea6a4d92b7007c0c8b3efc2 /puppet/modules
parentdd1d82e86515d25dcb20ffbb62e10fc4c51600d4 (diff)
Force jenkins win slave to reboot when slave exits
To fix issues where jenkins win slave gives an exception right after starting a job, we will reboot the node when there is some problems with the slave's connection. The root cause for the original problem seems to be unreliable network connection, where master never gets the information that the node went down. After reboot when node is trying to re-connect, master rejects the request, while it thinks the node is already connected. Task-number: QTQAINFRA-846 Change-Id: I6edc4d9ab57f63121e5148f3449b7fa3dea021d5 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Diffstat (limited to 'puppet/modules')
-rwxr-xr-xpuppet/modules/jenkins_slave/templates/jenkins-slave.pl.erb3
1 files changed, 3 insertions, 0 deletions
diff --git a/puppet/modules/jenkins_slave/templates/jenkins-slave.pl.erb b/puppet/modules/jenkins_slave/templates/jenkins-slave.pl.erb
index 938015b..509c1b3 100755
--- a/puppet/modules/jenkins_slave/templates/jenkins-slave.pl.erb
+++ b/puppet/modules/jenkins_slave/templates/jenkins-slave.pl.erb
@@ -127,6 +127,9 @@ sub run_slave_jar
system( @cmd );
warn "system( @cmd ): $? $!";
+ if ($OSNAME =~ m{win32}i) { # To prevent unnecessary re-connections, just reboot if in win. See QTQAINFRA-846
+ system( qw(shutdown /r /t 5 /c), "Jenkins slave unexpectedly terminated" );
+ }
# If Jenkins was able to run for at least this amount of time, we assume that the slave
# was able to connect to the server and work somewhat correctly for a while, but now