Jenkins slave losing connection

From snippet wiki
Jump to navigation Jump to search

For some combinations a Jenkins slave could somehow connect and disconnect from his master without any visible reason. Those errors will have something with ping timeout in the log. You could just shorten that ping interval per client by editing the file jenkins-slave.xml which is on the slave system in the jenkins root folder and add the pingInterval to this:

<arguments>-Dhudson.slaves.ChannelPinger.pingInterval=2 -Xrs  -jar "%BASE%\slave.jar" -jnlpUrl https://ci.example.com/.../slave-agent.jnlp -secret 123def-noCertificateCheck</arguments>

As the default seems to be 5 minutes, reducing to 2 minutes will keep the connection up and running.