-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-62043] Fix NPE which broke Jenkins builds #452
Conversation
In PR #433, which was released in AWS EC2 Plugin 1.50, a bug was introduced due to improper handling of an important transient field which is accessed very frequently by the Jenkins server due to it being referenced in `EC2AbstractSlave.isAcceptingTasks()`. This broke any Jenkins user which had running EC2 Nodes during the update to plugin 1.50 (see https://issues.jenkins-ci.org/browse/JENKINS-62043 for details).
This looks like this should work. @res0nance @jvz @fcojfernandez |
Spurious failure from Spotbugs - it's wrong about this one:
Going to update the PR to make it happy. 😝 |
Turned off a Spotbugs rule which incorrectly understands how Java serialization works, and which thought a transient field couldn't be null in Object.readResolve() when it actually can be.
Unable to request a PR review directly due to permissions, but this is a fix for a blocker issue with the 1.50 release of the AWS EC2 plugin @res0nance @jvz @fcojfernandez @thoulen - please see https://issues.jenkins-ci.org/browse/JENKINS-62043 |
spotbugs-exclude.xml
Outdated
@@ -6,4 +6,9 @@ | |||
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/> | |||
</Or> | |||
</Match> | |||
<Match> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should revert changes to this file and instead remove
@Nonnull |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will give that a shot and see if Spotbugs is happy with that
Removed a javax.annotation.Nonnull annotation from a transient field to silence a Spotbugs warning which incorrectly flagged a field as never being null when it can in fact be null due to Java serialization semantics
Code in EC2AbstractSlave was updated to remove a javax.annotation.Nonnull annotation, so this Spotbugs warning should no longer trigger and we can remove the exclusion.
@res0nance thanks! That suggestion cleaned things up! Who has write permissions and can merge this into the downstream repository and cut a new AWS EC2 Plugin release? I'm assuming we would want to call this 1.50.1 since it's an emergency bugfix to 1.50 |
I can cut a new release, I'm trying to get one other person's eyes on this before making a new release |
After this goes in can we also get some serialization/ deserialization tests? I have no idea where to start, so maybe someone could write a test that would catch this. |
In PR #433, which was released in AWS EC2 Plugin 1.50, a bug was introduced due to improper
handling of an important transient field which is accessed very frequently by the Jenkins server
due to it being referenced in
EC2AbstractSlave.isAcceptingTasks()
. This broke any Jenkinsuser which had running EC2 Nodes during the update to plugin 1.50 (see
https://issues.jenkins-ci.org/browse/JENKINS-62043 for details).