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

Base class setChannel does not handle exceptions from onOnline call

    Details

    • Similar Issues:
    • Released As:
      Jenkins 2.177, LTS 2.176.1

      Description

      Throwing an exception in ComputerListener.onOnline should not take a node offline:

      core/src/main/java/hudson/slaves/ComputerListener.java#L135-L164

      However, there a number of issues filed that show exceptions in onOnline not being handled, the latest being one in branch-api:

      jenkinsci/branch-api-plugin PR #142

      Here is the code used in on the Master node and the related test:

      core/src/main/java/jenkins/model/Jenkins.java#L979-L993
      test/src/test/java/jenkins/model/JenkinsTest.java#L473-L487

      Here is the code in SlaveComputer.setChannel() and the test file showing no test:
      core/src/main/java/hudson/slaves/SlaveComputer.java#L696-L698
      test/src/test/java/hudson/slaves/SlaveComputerTest.java

      NOTE: the Jenkins.java code is not correct either since it will swallow more than the contract specifies - including NullPointerException for example. Also, it should probably be a WARNING rather than SEVERE.

        Attachments

          Issue Links

            Activity

            Hide
            bitwiseman Liam Newman added a comment -

            Linked issues are likely all due to this one.

            Show
            bitwiseman Liam Newman added a comment - Linked issues are likely all due to this one.
            Hide
            bitwiseman Liam Newman added a comment -

            PR merged. Will be release in the next couple weeks to weekly build.

            Show
            bitwiseman Liam Newman added a comment - PR merged. Will be release in the next couple weeks to weekly build.
            Hide
            bitwiseman Liam Newman added a comment -

            Published in v2.177.

            Show
            bitwiseman Liam Newman added a comment - Published in v2.177.
            Hide
            bitwiseman Liam Newman added a comment -

            The next LTS will be out in June, but the base looks like it will be 2.176 - missed by one. I will see what I can do to get this pulled into that release.

            Show
            bitwiseman Liam Newman added a comment - The next LTS will be out in June, but the base looks like it will be 2.176 - missed by one. I will see what I can do to get this pulled into that release.
            Hide
            bitwiseman Liam Newman added a comment - - edited

            LTS Justification:
            This fixes long-standing agent disconnect issues for a number of plugins, probably more than just the ones linked. This change is very low risk.

            Show
            bitwiseman Liam Newman added a comment - - edited LTS Justification: This fixes long-standing agent disconnect issues for a number of plugins, probably more than just the ones linked. This change is very low risk.

              People

              • Assignee:
                bitwiseman Liam Newman
                Reporter:
                bitwiseman Liam Newman
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: