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

WorkspaceListLeasePickle should help diagnose locked workspaces

      "Waiting to acquire /.../workspace/... : jenkins.util.Timer [#...]" id=... (0x...) state=WAITING cpu=75%
          - waiting on <0x...> (a hudson.slaves.WorkspaceList)
          - locked <0x...> (a hudson.slaves.WorkspaceList)
          at java.lang.Object.wait(Native Method)
          at java.lang.Object.wait(Object.java:502)
          at hudson.slaves.WorkspaceList.acquire(WorkspaceList.java:255)
          at hudson.slaves.WorkspaceList.acquire(WorkspaceList.java:234)
          at hudson.slaves.WorkspaceList.acquire(WorkspaceList.java:223)
          at org.jenkinsci.plugins.workflow.support.pickles.WorkspaceListLeasePickle$1.tryResolve(WorkspaceListLeasePickle.java:67)
          at org.jenkinsci.plugins.workflow.support.pickles.WorkspaceListLeasePickle$1.tryResolve(WorkspaceListLeasePickle.java:52)
          at org.jenkinsci.plugins.workflow.support.pickles.TryRepeatedly$1.run(TryRepeatedly.java:62)
          at ...
      

      Looks like a workspace did not get relocked fast enough to avoid getting grabbed by some other job?

      At a minimum, WorkspaceListLeasePickle should printWaitingMessage when acquire blocks, so it is clearer from the build log why the build is still stuck.

      Possibly it should fail if it cannot acquire the workspace immediately, since in this case the workspace can be assumed to have already been clobbered by something else. Currently there is no such core API.

          [JENKINS-37121] WorkspaceListLeasePickle should help diagnose locked workspaces

          Jesse Glick created issue -
          Jesse Glick made changes -
          Epic Link New: JENKINS-35399 [ 171192 ]
          Jesse Glick made changes -
          Link New: This issue blocks JENKINS-26130 [ JENKINS-26130 ]

          Jesse Glick added a comment -

          JENKINS-22767 is one conceivable cause of the situation reported here: one copy of a build locked the workspace upon resumption, and soon after another copy was somehow produced and tried to run, but got stuck attempting to relock the same workspace.

          Jesse Glick added a comment - JENKINS-22767 is one conceivable cause of the situation reported here: one copy of a build locked the workspace upon resumption, and soon after another copy was somehow produced and tried to run, but got stuck attempting to relock the same workspace.
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-22767 [ JENKINS-22767 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "workflow-durable-task-step PR 14 (Web Link)" [ 14692 ]
          Jesse Glick made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]

          Code changed in jenkins
          User: Jesse Glick
          Path:
          support/src/main/java/org/jenkinsci/plugins/workflow/support/pickles/WorkspaceListLeasePickle.java
          http://jenkins-ci.org/commit/pipeline-plugin/bed2b2e58b181f7b67df14229410199f307eedce
          Log:
          JENKINS-37121 Use WorkspaceList.record, not .acquire, when dehydrating a pickle
          Backports https://github.com/jenkinsci/workflow-durable-task-step-plugin/pull/14.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: support/src/main/java/org/jenkinsci/plugins/workflow/support/pickles/WorkspaceListLeasePickle.java http://jenkins-ci.org/commit/pipeline-plugin/bed2b2e58b181f7b67df14229410199f307eedce Log: JENKINS-37121 Use WorkspaceList.record, not .acquire, when dehydrating a pickle Backports https://github.com/jenkinsci/workflow-durable-task-step-plugin/pull/14 .
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: