Skip to content

FIX JENKINS-54071#311

Merged
thoulen merged 4 commits intojenkinsci:masterfrom
thoulen:master
Oct 18, 2018
Merged

FIX JENKINS-54071#311
thoulen merged 4 commits intojenkinsci:masterfrom
thoulen:master

Conversation

@thoulen
Copy link
Contributor

@thoulen thoulen commented Oct 16, 2018

FIX JENKINS-54071

FIX JENKINS-54071
@thoulen thoulen requested review from julienduchesne and jvz October 16, 2018 22:31
StreamTaskListener listener = new StreamTaskListener(sw);
EC2AbstractSlave node = t.attach(id, listener);
Jenkins.getActiveInstance().addNode(node);
Jenkins.getInstance().addNode(node);
Copy link
Member

@jvz jvz Oct 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use Jenkins.get() to avoid NPE, though I don't remember which version of Jenkins added that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment the code is mainly using the getInstance(), and the getActiveInstance() is deprecated. If we want to move to jenkins.get() we should handle in a separate "global clean up"commit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that the build does not pass right now. You need to fix those NPEs before we can merge this. Otherwise, this will break releases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I am going to submit the patch for the problem reported by the findbugs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's amusing because Jenkins.getInstance() is a nullable method, but it wasn't an issue until they broke up the methods.

Copy link
Contributor

@julienduchesne julienduchesne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the possible NPEs found by findbugs, this LGTM

StartInstancesRequest siRequest = new StartInstancesRequest(instances);
StartInstancesResult siResult = ec2.startInstances(siRequest);

StartInstancesResult siResult = ec2.startInstances(siRequest);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added whitespace

@thoulen thoulen closed this Oct 17, 2018
@thoulen thoulen reopened this Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants