Frage

I have got the Jenkins issue, that when i turn off my nodes at all, in Jenkins they are still running, and they can be run nearly 20 minutes, also builds can take this node and start on it as the result they failed. Maybe there are any ways to reduce this time? i think that trouble in Jenkins configuration, but i don't know where, help.

War es hilfreich?

Lösung

Your best option is to navigate to the slave page in Jenkins and click the "Offline" button. This takes the slave offline i.e. it will not pick up new builds from the queue.

Even better is to click on the "Disconnect" button, which shuts down the slave agent and disconnects from the slave. Then you can safely turn off the slave node.

The offline and disconnect can also be executed using the Jenkins command line client (see https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI).

If this is not possible, then you must use the slave type which allows you to specify your own way to connect to the slaves (https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds#Distributedbuilds-WriteyourownscripttolaunchJenkinsslaves). You must then use something like an SSH tunnel that is configured to use keepalive or otherwise "ping" the other end to discover if it has gone away.

You see, a TCP connection does not die if the other computer goes away without telling the other end. The only way to detect if a connection is alive is to send something. It is possible to configure the operating system TCP/IP stack to enable keepalive check for the TCP connection but the TCP level keepalive check only happens like once an hour. If you need a quicker detection for dead connection, it must be done at application layer.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top