[JIRA] (JENKINS-57111) Base class setChannel does not handle exceptions from onOnline call

23 views
Skip to first unread message

bitwiseman@gmail.com (JIRA)

unread,
Apr 18, 2019, 2:34:02 PM4/18/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Apr 18, 2019, 2:36:02 PM4/18/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Apr 18, 2019, 3:00:03 PM4/18/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Apr 18, 2019, 3:01:01 PM4/18/19
to jenkinsc...@googlegroups.com
Also, it should probably be a WARNING rather than SEVERE.

bitwiseman@gmail.com (JIRA)

unread,
Apr 18, 2019, 3:16:02 PM4/18/19
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
Throwing an exception in ComputerListener.onOnline should not take a node offline:


However, there a number of issues filed that show exceptions in onOnline not being handled, the latest being one in branch-api:
https://github.com/jenkinsci/branch-api-plugin/pull/142

Here is the code used in on the Master node and the related test:
https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/core/src/main/java/jenkins/model/Jenkins.java#L979-L993
https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/test/src/test/java/jenkins/model/JenkinsTest.java#L473-L487

Here is the code in hudson.slaves.SlaveComputer.setChannel and the test file showing no test:
https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/core/src/main/java/hudson/slaves/SlaveComputer.java#L696-L698
https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/test/src/test/java/hudson/slaves/SlaveComputerTest.java#L45

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.

bitwiseman@gmail.com (JIRA)

unread,
Apr 18, 2019, 3:20:02 PM4/18/19
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
Throwing an exception in ComputerListener.onOnline should not take a node offline:

[ https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/ core/src/main/java/hudson/slaves/ComputerListener.java#L135-L164| https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/ 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:

[
https://github.com/jenkinsci/branch-api-plugin/pull/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|
https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/core/src/main/java/jenkins/model/Jenkins.java#L979-L993 ]
[test/src/test/java/jenkins/model/JenkinsTest.java#L473-L487| https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/test/src/test/java/jenkins/model/JenkinsTest.java#L473-L487 ]

Here is the code in
hudson.slaves. SlaveComputer.setChannel () and the test file showing no test:
[core/src/main/java/hudson/slaves/SlaveComputer.java#L696-L698| https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/core/src/main/java/hudson/slaves/SlaveComputer.java#L696-L698 ]
[test/src/test/java/hudson/slaves/SlaveComputerTest.java| https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/test/src/test/java/hudson/slaves/SlaveComputerTest.java #L45 ]

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.

bitwiseman@gmail.com (JIRA)

unread,
Apr 18, 2019, 3:21:02 PM4/18/19
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
Throwing an exception in ComputerListener.onOnline should not take a node offline:



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| https://github.com/jenkinsci/branch-api-plugin/pull/142]
Here is the code in SlaveComputer.setChannel() and the test file showing no test:
[core/src/main/java/hudson/slaves/SlaveComputer.java#L696-L698|https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/core/src/main/java/hudson/slaves/SlaveComputer.java#L696-L698]
[test/src/test/java/hudson/slaves/SlaveComputerTest.java|https://github.com/jenkinsci/jenkins/blob/2767b00146ce2ff2738b7fd7c6db95a26b8f9f39/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.

bitwiseman@gmail.com (JIRA)

unread,
May 7, 2019, 1:27:02 PM5/7/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
May 7, 2019, 1:27:02 PM5/7/19
to jenkinsc...@googlegroups.com
Liam Newman started work on Bug JENKINS-57111
 
Change By: Liam Newman
Status: Open In Progress

bitwiseman@gmail.com (JIRA)

unread,
May 7, 2019, 9:24:02 PM5/7/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
May 13, 2019, 12:46:03 AM5/13/19
to jenkinsc...@googlegroups.com
 

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

Change By: Liam Newman
Status: In Review Fixed but Unreleased
Resolution: Fixed

bitwiseman@gmail.com (JIRA)

unread,
May 13, 2019, 10:33:02 AM5/13/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
May 13, 2019, 10:34:02 AM5/13/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
May 14, 2019, 12:30:02 PM5/14/19
to jenkinsc...@googlegroups.com

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.

bitwiseman@gmail.com (JIRA)

unread,
May 14, 2019, 12:34:01 PM5/14/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
May 14, 2019, 12:36:01 PM5/14/19
to jenkinsc...@googlegroups.com
 
Re: Base class setChannel does not handle exceptions from onOnline call

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

bitwiseman@gmail.com (JIRA)

unread,
May 14, 2019, 12:40:02 PM5/14/19
to jenkinsc...@googlegroups.com
Liam Newman edited a comment on Bug JENKINS-57111
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.

o.v.nenashev@gmail.com (JIRA)

unread,
May 16, 2019, 12:50:02 AM5/16/19
to jenkinsc...@googlegroups.com

ogondza@gmail.com (JIRA)

unread,
May 23, 2019, 3:39:03 AM5/23/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
May 24, 2019, 12:19:03 PM5/24/19
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
Change By: Liam Newman
Released As: Jenkins 2.177 , LTS 2.176.1

bitwiseman@gmail.com (JIRA)

unread,
Nov 4, 2019, 2:47:03 PM11/4/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Fixed
Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages