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

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      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

            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

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

            Show
            kohsuke Kohsuke Kawaguchi added a comment - I think this would address some of the root cause in a blanket issue like JENKINS-5413 .
            Hide
            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.

            Show
            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.
            Hide
            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.

            Show
            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.
            Hide
            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

            Show
            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
            Hide
            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
            Show
            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
            Hide
            imakowski Ireneusz Makowski added a comment -

            please add this to lts also

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

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

            Show
            danielbeck Daniel Beck added a comment - 1.554.x is finished, and 1.565.x will include this anyway.
            Hide
            oldelvet Richard Mortimer added a comment -

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

            Show
            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

              • Assignee:
                kohsuke Kohsuke Kawaguchi
                Reporter:
                kohsuke Kohsuke Kawaguchi
              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: