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

Allow steps to decorate thread dumps

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Currently the only information you get from a virtual thread dump for a build waiting inside a StepExecution is the function name of the step, plus the stack trace of the Groovy code calling it of course. But steps may have richer information available about why they are paused. For example, a DurableTaskStep could indicate that it is waiting for a particular jenkins-result.txt file (specifying the node name and absolute path). Or a BuildTriggerStep might be able to say whether it is waiting on a queue item or a particular downstream build.

      To surface this information to a user or support technician we would like an API in StepExecution allowing the running step to give information about what it is doing and why: some kind of short message that would fit naturally at the top of a stack trace.

      A partial workaround is for steps to print messages to the build log when stop is called, though this implies that you are ready to halt the build. The information may also be superfluous if the step's normal shutdown procedure in fact works; for example the process killing in DurableTaskStepExecution.stop need not print any special message if the process responds to the signal.

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue is blocking JENKINS-29705 [ JENKINS-29705 ]
            jglick Jesse Glick made changes -
            Labels api api diagnostics
            jglick Jesse Glick made changes -
            Epic Link JENKINS-35396 [ 171189 ]
            Hide
            jglick Jesse Glick added a comment -

            CpsThreadDump would call the new API.

            Other implementations could include: ExecutorStepExecution (show whether the PlaceholderTask is waiting in queue, and if so, why—CauseOfBlockage); SleepStep.Execution and TimeoutStepExecution (show remaining time); AbstractSynchronousNonBlockingStepExecution (indicate thread name where the code is running in a regular thread dump); LockStep (owner of lock); ParallelStepExecution (which branches are still alive).

            Show
            jglick Jesse Glick added a comment - CpsThreadDump would call the new API. Other implementations could include: ExecutorStepExecution (show whether the PlaceholderTask is waiting in queue, and if so, why— CauseOfBlockage ); SleepStep.Execution and TimeoutStepExecution (show remaining time); AbstractSynchronousNonBlockingStepExecution (indicate thread name where the code is running in a regular thread dump); LockStep (owner of lock); ParallelStepExecution (which branches are still alive).
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-26130 [ JENKINS-26130 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-api PR 7 (Web Link)" [ 14539 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-durable-task-step PR 9 (Web Link)" [ 14540 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-cps PR 25 (Web Link)" [ 14541 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "durable-task PR 26 (Web Link)" [ 14543 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-step-api PR 4 (Web Link)" [ 14544 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-basic-steps PR 9 (Web Link)" [ 14545 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "pipeline-build-step PR 3 (Web Link)" [ 14546 ]
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-36254 [ JENKINS-36254 ]
            Hide
            jglick Jesse Glick added a comment -

            ParallelStepExecution.toString could probably check which ResultHandler.outcomes are finalized, though I am not sure this is particularly relevant in practice.

            Show
            jglick Jesse Glick added a comment - ParallelStepExecution.toString could probably check which ResultHandler.outcomes are finalized, though I am not sure this is particularly relevant in practice.
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 167292 ] JNJira + In-Review [ 198152 ]
            abayer Andrew Bayer made changes -
            Component/s pipeline-general [ 21692 ]
            abayer Andrew Bayer made changes -
            Component/s workflow-plugin [ 18820 ]
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-39275 [ JENKINS-39275 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/pickles/Pickle.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/3705e3f13c84ae5a29a1cba0884e5e67f54e7caa
            Log:
            JENKINS-26130 JENKINS-31842 Request that pickle futures be printable.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/pickles/Pickle.java http://jenkins-ci.org/commit/workflow-cps-plugin/3705e3f13c84ae5a29a1cba0884e5e67f54e7caa Log: JENKINS-26130 JENKINS-31842 Request that pickle futures be printable.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/pickles/Pickle.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/fcfd11127a794463bf178d86fb88e2414a51ed1f
            Log:
            Merge pull request #7 from jglick/CpsThreadDump-JENKINS-31842

            JENKINS-31842 Thread dump improvements

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/pickles/Pickle.java http://jenkins-ci.org/commit/workflow-cps-plugin/fcfd11127a794463bf178d86fb88e2414a51ed1f Log: Merge pull request #7 from jglick/CpsThreadDump- JENKINS-31842 JENKINS-31842 Thread dump improvements

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: