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

PublishHTMLStepExecution.run can block CPS thread

      A stack trace from a Jenkins instance running this plugin contained a thread blocked like this:

      "Running CpsFlowExecution[Owner[...]]" #... daemon ... in Object.wait() [...]
         java.lang.Thread.State: TIMED_WAITING (on object monitor)
          at java.lang.Object.wait(Native Method)
          at hudson.remoting.FastPipedInputStream.read(FastPipedInputStream.java:175)
          - locked <...> (a [B)
          at hudson.util.HeadBufferingStream.read(HeadBufferingStream.java:61)
          at com.jcraft.jzlib.InflaterInputStream.fill(InflaterInputStream.java:175)
          at com.jcraft.jzlib.InflaterInputStream.read(InflaterInputStream.java:106)
          at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.read(TarArchiveInputStream.java:614)
          at java.io.InputStream.read(InputStream.java:101)
          at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792)
          at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
          at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
          at hudson.util.IOUtils.copy(IOUtils.java:40)
          at hudson.FilePath.readFromTar(FilePath.java:2318)
          at hudson.FilePath.copyRecursiveTo(FilePath.java:2237)
          at hudson.FilePath.copyRecursiveTo(FilePath.java:2141)
          at hudson.FilePath.copyRecursiveTo(FilePath.java:2124)
          at htmlpublisher.HtmlPublisher.publishReports(HtmlPublisher.java:258)
          at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:67)
          at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:43)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
          at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
          at ...
      

      Steps which make network calls or do I/O or otherwise might block must not run in the CPS thread.

          [JENKINS-40447] PublishHTMLStepExecution.run can block CPS thread

          Jesse Glick created issue -
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "PR 26 (Web Link)" [ 15129 ]
          Jesse Glick made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          src/main/java/htmlpublisher/HtmlPublisher.java
          src/main/java/htmlpublisher/HtmlPublisherTarget.java
          src/main/java/htmlpublisher/workflow/PublishHTMLStepExecution.java
          src/main/resources/htmlpublisher/HtmlPublisher/config.jelly
          src/main/resources/htmlpublisher/HtmlPublisherTarget/HTMLAction/sidepanel.jelly
          src/main/resources/htmlpublisher/HtmlPublisherTarget/HTMLBuildAction/sidepanel.jelly
          src/main/resources/index.jelly
          http://jenkins-ci.org/commit/htmlpublisher-plugin/f2a4519bc47a4b1f9cedc37affb9d5be65122213
          Log:
          [FIXED JENKINS-40447] Use AbstractSynchronousNonBlockingStepExecution, which requires updating to 1.609.x.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/htmlpublisher/HtmlPublisher.java src/main/java/htmlpublisher/HtmlPublisherTarget.java src/main/java/htmlpublisher/workflow/PublishHTMLStepExecution.java src/main/resources/htmlpublisher/HtmlPublisher/config.jelly src/main/resources/htmlpublisher/HtmlPublisherTarget/HTMLAction/sidepanel.jelly src/main/resources/htmlpublisher/HtmlPublisherTarget/HTMLBuildAction/sidepanel.jelly src/main/resources/index.jelly http://jenkins-ci.org/commit/htmlpublisher-plugin/f2a4519bc47a4b1f9cedc37affb9d5be65122213 Log: [FIXED JENKINS-40447] Use AbstractSynchronousNonBlockingStepExecution, which requires updating to 1.609.x.

          Ryan Campbell added a comment -

          Released as htmlpublisher-1.12

          Ryan Campbell added a comment - Released as htmlpublisher-1.12
          Ryan Campbell made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]

          jglick rather than try and recreate to confirm this is actually fixed, are you able to confirm that this is indeed resolved? Just tidying up old issues and want to close out any which I can.

          Richard Bywater added a comment - jglick rather than try and recreate to confirm this is actually fixed, are you able to confirm that this is indeed resolved? Just tidying up old issues and want to close out any which I can.

          Jesse Glick added a comment -

          I never attempted to reproduce. Just saw something incorrect in the code with a straightforward fix, and wrote the patch accordingly.

          Jesse Glick added a comment - I never attempted to reproduce. Just saw something incorrect in the code with a straightforward fix, and wrote the patch accordingly.

          In that case closing the issue - thanks!

          Richard Bywater added a comment - In that case closing the issue - thanks!
          Richard Bywater made changes -
          Assignee Original: Jesse Glick [ jglick ] New: Richard Bywater [ r2b2_nz ]
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            r2b2_nz Richard Bywater
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: