Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-19055

In case of connection loss, slave JVM should restart itself if it can

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • core
    • None

    Description

      "java -jar slave.jar" currently has a logic that keeps on reconnecting if a connection is dropped. This is good, but over a long run, if any memory leak happens during a connection, it'll slowly clog up the JVM.

      On Unix, it is better to exec to itself to start clean in case of a connection loss. On slaves managed as a Windows service, it is better to just terminate the process and let Windows SCM launch a new one.

      Slaves should do this kind of intelligent reconnection, much like how Jenkins master restarts itself.

      Attachments

        Issue Links

          Activity

            I think this would address some of the root cause in a blanket issue like JENKINS-5413.

            kohsuke Kohsuke Kawaguchi added a comment - I think this would address some of the root cause in a blanket issue like JENKINS-5413 .

            Adding JENKINS-22454, because currently this fix requires administrators to manually overwrite slave.jar with 2.37 or later.

            kohsuke Kohsuke Kawaguchi added a comment - Adding JENKINS-22454 , because currently this fix requires administrators to manually overwrite slave.jar with 2.37 or later.

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java
            core/src/main/java/jenkins/slaves/restarter/SlaveRestarter.java
            core/src/main/java/jenkins/slaves/restarter/UnixSlaveRestarter.java
            core/src/main/java/jenkins/slaves/restarter/WinswSlaveRestarter.java
            http://jenkins-ci.org/commit/jenkins/78154778c8f84062432900645efc09f77b712479
            Log:
            JENKINS-19055

            Adding extension point so that the master can install code that restarts JNLP slaves.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java core/src/main/java/jenkins/slaves/restarter/SlaveRestarter.java core/src/main/java/jenkins/slaves/restarter/UnixSlaveRestarter.java core/src/main/java/jenkins/slaves/restarter/WinswSlaveRestarter.java http://jenkins-ci.org/commit/jenkins/78154778c8f84062432900645efc09f77b712479 Log: JENKINS-19055 Adding extension point so that the master can install code that restarts JNLP slaves.

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            changelog.html
            http://jenkins-ci.org/commit/jenkins/06669e314a2217a7a80ac15d2b2a44a0d802fd71
            Log:
            [FIXED JENKINS-19055]

            The actual fix has been implemented over the last dozen or so commits

            Compare: https://github.com/jenkinsci/jenkins/compare/4a23ad981914...06669e314a22

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/06669e314a2217a7a80ac15d2b2a44a0d802fd71 Log: [FIXED JENKINS-19055] The actual fix has been implemented over the last dozen or so commits Compare: https://github.com/jenkinsci/jenkins/compare/4a23ad981914...06669e314a22
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #3274
            JENKINS-19055 (Revision 78154778c8f84062432900645efc09f77b712479)
            [FIXED JENKINS-19055] (Revision 06669e314a2217a7a80ac15d2b2a44a0d802fd71)

            Result = SUCCESS
            kohsuke : 78154778c8f84062432900645efc09f77b712479
            Files :

            • core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java
            • core/src/main/java/jenkins/slaves/restarter/WinswSlaveRestarter.java
            • core/src/main/java/jenkins/slaves/restarter/UnixSlaveRestarter.java
            • core/src/main/java/jenkins/slaves/restarter/SlaveRestarter.java

            kohsuke : 06669e314a2217a7a80ac15d2b2a44a0d802fd71
            Files :

            • changelog.html
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3274 JENKINS-19055 (Revision 78154778c8f84062432900645efc09f77b712479) [FIXED JENKINS-19055] (Revision 06669e314a2217a7a80ac15d2b2a44a0d802fd71) Result = SUCCESS kohsuke : 78154778c8f84062432900645efc09f77b712479 Files : core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java core/src/main/java/jenkins/slaves/restarter/WinswSlaveRestarter.java core/src/main/java/jenkins/slaves/restarter/UnixSlaveRestarter.java core/src/main/java/jenkins/slaves/restarter/SlaveRestarter.java kohsuke : 06669e314a2217a7a80ac15d2b2a44a0d802fd71 Files : changelog.html

            please add this to lts also

            imakowski Ireneusz Makowski added a comment - please add this to lts also
            danielbeck Daniel Beck added a comment -

            1.554.x is finished, and 1.565.x will include this anyway.

            danielbeck Daniel Beck added a comment - 1.554.x is finished, and 1.565.x will include this anyway.

            This fix is causing jnlp slaves to fail to reconnect when the master is restarted. See JENKINS-24272

            oldelvet Richard Mortimer added a comment - This fix is causing jnlp slaves to fail to reconnect when the master is restarted. See JENKINS-24272

            People

              kohsuke Kohsuke Kawaguchi
              kohsuke Kohsuke Kawaguchi
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: