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

DurableTaskStep$Execution.getStatus can hang

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      There is some improvements to be made in the support core plugin (will create a different jira), but there is a case where the pipeline step executions toString method can hang forever if it is unable to obtain the durable task steps workspace:

      "Running CpsFlowExecution[Owner[JOB_NAME:JOB_NAME#BUILD_NUMBER]] / waiting for hudson.remoting.Channel@111111111:NODE_NAME" #1 daemon prio=5 os_prio=0 tid=0x000000002e00d800 nid=0x4a8 in Object.wait() [0x000000002f5de000]
         java.lang.Thread.State: TIMED_WAITING (on object monitor)
          at java.lang.Object.wait(Native Method)
          at hudson.remoting.Request.call(Request.java:147)
          - locked <0x00000007b795ff98> (a hudson.remoting.UserRequest)
          at hudson.remoting.Channel.call(Channel.java:780)
          at hudson.FilePath.act(FilePath.java:979)
          at hudson.FilePath.act(FilePath.java:968)
          at hudson.FilePath.isDirectory(FilePath.java:1504)
          at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.getWorkspace(DurableTaskStep.java:108)
          at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.getStatus(DurableTaskStep.java:153)
          at org.jenkinsci.plugins.workflow.steps.StepExecution.toString(StepExecution.java:98)
          at java.lang.String.valueOf(String.java:2994)
          at java.lang.StringBuilder.append(StringBuilder.java:131)
          at java.util.AbstractCollection.toString(AbstractCollection.java:462)
          at java.util.Collections$UnmodifiableCollection.toString(Collections.java:1035)
          at java.text.MessageFormat.subformat(MessageFormat.java:1280)
          at java.text.MessageFormat.format(MessageFormat.java:865)
          at java.text.Format.format(Format.java:157)
          at java.text.MessageFormat.format(MessageFormat.java:841)
          at java.util.logging.Formatter.formatMessage(Formatter.java:138)
          - locked <0x00000006c394e168> (a com.cloudbees.jenkins.support.SupportLogFormatter)
          at com.cloudbees.jenkins.support.SupportLogFormatter.format(SupportLogFormatter.java:89)
          at java.util.logging.StreamHandler.publish(StreamHandler.java:211)
          - locked <0x00000006c394e130> (a java.util.logging.StreamHandler)
          at com.cloudbees.jenkins.support.impl.JenkinsLogs$LogFile.publish(JenkinsLogs.java:544)
          at com.cloudbees.jenkins.support.impl.JenkinsLogs$CustomHandler.publish(JenkinsLogs.java:583)
          at java.util.logging.Logger.log(Logger.java:738)
          at java.util.logging.Logger.doLog(Logger.java:765)
          at java.util.logging.Logger.log(Logger.java:830)
          at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$ItemListenerImpl$1.onSuccess(FlowExecutionList.java:177)
      

      I believe the issue is that the StepExecution.toString make a call to getStatus which if it is currently in a DurableTaskStep.getStatus method call it will try to get the workspace which could potentially hang if something has happened to the channel.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            getStatus is expected to return quickly and reliably, so nothing to be done in support-core.

            Show
            jglick Jesse Glick added a comment - getStatus is expected to return quickly and reliably, so nothing to be done in support-core .
            Hide
            jglick Jesse Glick added a comment -

            Note that the stack trace quoted above should only happen if you have enabled a FINE logger.

            Show
            jglick Jesse Glick added a comment - Note that the stack trace quoted above should only happen if you have enabled a FINE logger.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThreadDump.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/a08717eaea66e211a6d0e01bbf171b814f8bf96c
            Log:
            JENKINS-39275 Extend time limit to virtual thread dump.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThreadDump.java http://jenkins-ci.org/commit/workflow-cps-plugin/a08717eaea66e211a6d0e01bbf171b814f8bf96c Log: JENKINS-39275 Extend time limit to virtual thread dump.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThreadDump.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/8803767e994f24d8606c80ace97f7468deaaf34d
            Log:
            Merge pull request #81 from jglick/getStatus-JENKINS-39275

            JENKINS-39275 Extend time limit to virtual thread dump

            Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/4c00f9988826...8803767e994f

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThreadDump.java http://jenkins-ci.org/commit/workflow-cps-plugin/8803767e994f24d8606c80ace97f7468deaaf34d Log: Merge pull request #81 from jglick/getStatus- JENKINS-39275 JENKINS-39275 Extend time limit to virtual thread dump Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/4c00f9988826...8803767e994f

              People

              • Assignee:
                Unassigned
                Reporter:
                schristou Steven Christou
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: