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

CLONE -Gerrit stops sending verifications with the Hudson 1.375 release (1.373 works)

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin
    • None
    • CentOS

      Hello,

      An RPM update of Hudson yesterday (to 1.375) prevents the gerrit trigger plugin from publishing the results of a build back to Gerrit. We downgraded hudson back to 1.373, and the problem went away. When the build starts, the "Starting build" message does make it to Gerrit, but though the build completes, Gerrit is not notified of the completion, and manual verification of the patch is required.

      Attached is what looks like the relevant hudson log portion. Please let me know if you need anything else.

      Thanks for a great plugin!

      Cheers,

      Bill Shupp

          [JENKINS-7446] CLONE -Gerrit stops sending verifications with the Hudson 1.375 release (1.373 works)

          glundh added a comment -

          It seems this error is due to the buildsByBranchName Hashmap in the hudson.plugins.git.util.BuildData action gets in a state where a key is null:

          println(Hudson.getInstance().getItem("EXPERIMENTAL_Gerrit_Trigger_2").getBuildByNumber(13).getAction(hudson.plugins.git.util.BuildData).buildsByBranchName);

          null:Build #13 of Revision 0f566fdae8a0a3fb06780a976ac41bc97b138383 (null)

          Hudson.getInstance().getItem("EXPERIMENTAL_Gerrit_Trigger_2").getBuildByNumber(13).save();

          java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class hudson.model.FreeStyleBuild
          at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167)
          at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135)

          If I clear buildsByBranchName, everything is OK:

          Hudson.getInstance().getItem("EXPERIMENTAL_Gerrit_Trigger_2").getBuildByNumber(13).getAction(hudson.plugins.git.util.BuildData).buildsByBranchName.clear();
          Hudson.getInstance().getItem("EXPERIMENTAL_Gerrit_Trigger_2").getBuildByNumber(13).save();

          <SUCCESS>

          The error in http://issues.jenkins-ci.org/browse/JENKINS-7330 seems also to depend on changes in the serialization logic in 1.374, making Hudson suddenly not accepting a null-string. So I guess they are indeed connected. Maybe we can achieve a similar patch for the GIT-plugin?

          glundh added a comment - It seems this error is due to the buildsByBranchName Hashmap in the hudson.plugins.git.util.BuildData action gets in a state where a key is null: println(Hudson.getInstance().getItem("EXPERIMENTAL_Gerrit_Trigger_2").getBuildByNumber(13).getAction(hudson.plugins.git.util.BuildData).buildsByBranchName); null:Build #13 of Revision 0f566fdae8a0a3fb06780a976ac41bc97b138383 (null) Hudson.getInstance().getItem("EXPERIMENTAL_Gerrit_Trigger_2").getBuildByNumber(13).save(); java.lang.RuntimeException: Failed to serialize hudson.model.Actionable#actions for class hudson.model.FreeStyleBuild at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:167) at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:135) If I clear buildsByBranchName, everything is OK: Hudson.getInstance().getItem("EXPERIMENTAL_Gerrit_Trigger_2").getBuildByNumber(13).getAction(hudson.plugins.git.util.BuildData).buildsByBranchName.clear(); Hudson.getInstance().getItem("EXPERIMENTAL_Gerrit_Trigger_2").getBuildByNumber(13).save(); <SUCCESS> The error in http://issues.jenkins-ci.org/browse/JENKINS-7330 seems also to depend on changes in the serialization logic in 1.374, making Hudson suddenly not accepting a null-string. So I guess they are indeed connected. Maybe we can achieve a similar patch for the GIT-plugin?

          Andrew Bayer added a comment -

          Ok - looks like changing from HashMap to TreeMap would fix that, but it'll need to translate past builds at upgrade time. Let me write up a patch and send you a link to the hpi to test.

          Andrew Bayer added a comment - Ok - looks like changing from HashMap to TreeMap would fix that, but it'll need to translate past builds at upgrade time. Let me write up a patch and send you a link to the hpi to test.

          dogfood added a comment -

          Integrated in plugins_hudson-git-plugin #24
          JENKINS-7446 First attempt at getting rid of null keys in buildsByBranchName.

          Andrew Bayer :
          Files :

          • src/main/java/hudson/plugins/git/util/BuildData.java

          dogfood added a comment - Integrated in plugins_hudson-git-plugin #24 JENKINS-7446 First attempt at getting rid of null keys in buildsByBranchName. Andrew Bayer : Files : src/main/java/hudson/plugins/git/util/BuildData.java

          Andrew Bayer added a comment -

          Actually, even simpler - just a readResolve to switch null keys to "" keys and then some checks to make sure we didn't add new null keys. You can grab the hpi at http://ci.hudson-labs.org/job/plugins_hudson-git-plugin/24/org.jvnet.hudson.plugins$git/

          Andrew Bayer added a comment - Actually, even simpler - just a readResolve to switch null keys to "" keys and then some checks to make sure we didn't add new null keys. You can grab the hpi at http://ci.hudson-labs.org/job/plugins_hudson-git-plugin/24/org.jvnet.hudson.plugins$git/

          rsandell added a comment -

          Great!
          Will do some tests first thing tomorrow morning.

          rsandell added a comment - Great! Will do some tests first thing tomorrow morning.

          glundh added a comment -

          The patch work great! Thanks, abayer! However, the GIT build action shows an empty bullet point. Is this supposed to happen? (Not sure if it is related to the patch)

          Screen attached.

          glundh added a comment - The patch work great! Thanks, abayer! However, the GIT build action shows an empty bullet point. Is this supposed to happen? (Not sure if it is related to the patch) Screen attached.

          glundh added a comment - - edited

          File attached.

          glundh added a comment - - edited File attached.

          Andrew Bayer added a comment -

          Lemme see if I can figure that out - I'm guessing that's a side effect of the "" key rather than null key.

          Andrew Bayer added a comment - Lemme see if I can figure that out - I'm guessing that's a side effect of the "" key rather than null key.

          Andrew Bayer added a comment -

          Got it! It was exactly that - I've fixed it now for both BuildData displays - check for the next build after #24 at http://ci.hudson-labs.org/job/plugins_hudson-git-plugin/lastSuccessfulBuild/

          Andrew Bayer added a comment - Got it! It was exactly that - I've fixed it now for both BuildData displays - check for the next build after #24 at http://ci.hudson-labs.org/job/plugins_hudson-git-plugin/lastSuccessfulBuild/

          Andrew Bayer added a comment -

          Resolved in 1.1.

          Andrew Bayer added a comment - Resolved in 1.1.

            rsandell rsandell
            rsandell rsandell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: