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

Fix ConcurrentModificationException in PlotBuildAction class

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Background

      New class called PlotBuildAction was added when compatibility with Pipeline plugin was implemented in https://github.com/jenkinsci/plot-plugin/pull/32.
      Seems like this class current implementation is not thread safe and user reported 1st time issue with ConcurrentModificationException in PR comment. Exception was not reproducible to me even though I used provided by reporter Jenkins & Pipeline configurations.
      There was an attempt to blindly fix the issue in commit, but it didn't work out.
      Second report about the same exception appeared recently.

      Sam Van Oort proposed copy-on-write approach rather than synchronized for methods. It should be considered as potential fix.

      Environment

      What should be done

      • We need to reproduce ConcurrentModificationException while accessing plots array in PlotBuildAction and fix it.
      • It's good to have a test for the fix

      How to test

        Attachments

          Activity

          Hide
          vgaidarji Veaceslav Gaidarji added a comment - - edited

          Similar issues:

          Not sure yet how to reproduce the CME, gathering more info from similar issues and trying to reproduce it in a test first.

          Show
          vgaidarji Veaceslav Gaidarji added a comment - - edited Similar issues: https://issues.jenkins-ci.org/browse/JENKINS-42720 https://issues.jenkins-ci.org/browse/JENKINS-44597 https://issues.jenkins-ci.org/browse/JENKINS-19561   https://issues.jenkins-ci.org/browse/JENKINS-34313   Not sure yet how to reproduce the CME, gathering more info from similar issues and trying to reproduce it in a test first.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Veaceslav Gaidarji
          Path:
          src/main/java/hudson/plugins/plot/PlotBuildAction.java
          src/test/java/hudson/plugins/plot/PlotBuildActionTest.java
          http://jenkins-ci.org/commit/plot-plugin/56fc2182807a04a763844f8bbb1b7ca3109d1d78
          Log:
          Merge pull request #40 from jenkinsci/JENKINS-48465-fix-concurrent-modification-exception

          JENKINS-48465 Fix ConcurrentModificationException in PlotBuildAction

          Compare: https://github.com/jenkinsci/plot-plugin/compare/490c98c4544f...56fc2182807a

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Veaceslav Gaidarji Path: src/main/java/hudson/plugins/plot/PlotBuildAction.java src/test/java/hudson/plugins/plot/PlotBuildActionTest.java http://jenkins-ci.org/commit/plot-plugin/56fc2182807a04a763844f8bbb1b7ca3109d1d78 Log: Merge pull request #40 from jenkinsci/ JENKINS-48465 -fix-concurrent-modification-exception JENKINS-48465 Fix ConcurrentModificationException in PlotBuildAction Compare: https://github.com/jenkinsci/plot-plugin/compare/490c98c4544f...56fc2182807a
          Hide
          vgaidarji Veaceslav Gaidarji added a comment -

          Fix included in 2.0.2 release. 

          Show
          vgaidarji Veaceslav Gaidarji added a comment - Fix included in 2.0.2 release. 

            People

            • Assignee:
              vgaidarji Veaceslav Gaidarji
              Reporter:
              vgaidarji Veaceslav Gaidarji
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: