jenkinsci / jenkinsci/git-plugin
[JENKINS-49556] Git polling using workspace blocked until running build completes
- Dominant language
- Java
- Stars
- 694
- Forks
- 1.1k
- Avg merge
- 1h 29m
- Merged PRs (30d)
- 3
Description
We have git polling enabled for a multijob project which requires the use of a local workspace as are using the "polling ignores commits with certain messages" option. Each build for this project takes around 1 hour.
If a build is running when polling triggers (either via schedule or from using the notifyCommit endpoint) it has to wait for the build that is running to finish before completing. This significantly reduces the throughput of our builds.
When looking at the Jenkins threads we see polling waiting on acquiring a workspace lock
```
"Waiting to acquire D:\jenkins-ci-slave\workspace\CI@2 : SCM polling for com.tikal.jenkins.plugins.multijob.MultiJobProject@504afb4[CI]" Id=19074 Group=main WAITING on hudson.slaves.WorkspaceList@468cbad2
at java.lang.Object.wait(Native Method)
- waiting on hudson.slaves.WorkspaceList@468cbad2
at java.lang.Object.wait(Unknown Source)
at hudson.slaves.WorkspaceList.acquire(WorkspaceList.java:257)
at hudson.slaves.WorkspaceList.acquire(WorkspaceList.java:236)
at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1399)
at hudson.model.AbstractProject._poll(AbstractProject.java:1376)
at hudson.model.AbstractProject.poll(AbstractProject.java:1287)
at com.tikal.jenkins.plugins.multijob.MultiJobProject.poll(MultiJobProject.java:95)
at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:594)
at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:640)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Number of locked synchronizers = 1
- java.util.concurrent.ThreadPoolExecutor$Worker@566b1062
```
At this point if we view the Git Polling Log for the project all we see is
```
Started on Feb 14, 2018 4:44:59 PM
```
Is there a way to have polling proceed whilst another build is in progress?
---
Originally reported by craigpaton, imported from: Git polling using workspace blocked until running build completes
Raw content of original issue
We have git polling enabled for a multijob project which requires the use of a local workspace as are using the "polling ignores commits with certain messages" option. Each build for this project takes around 1 hour.
If a build is running when polling triggers (either via schedule or from using the notifyCommit endpoint) it has to wait for the build that is running to finish before completing. This significantly reduces the throughput of our builds.
When looking at the Jenkins threads we see polling waiting on acquiring a workspace lock
"Waiting to acquire D:\jenkins-ci-slave\workspace\CI@2 : SCM polling for com.tikal.jenkins.plugins.multijob.MultiJobProject@504afb4[CI]" Id=19074 Group=main WAITING on hudson.slaves.WorkspaceList@468cbad2
at java.lang.Object.wait(Native Method)
- waiting on hudson.slaves.WorkspaceList@468cbad2
at java.lang.Object.wait(Unknown Source)
at hudson.slaves.WorkspaceList.acquire(WorkspaceList.java:257)
at hudson.slaves.WorkspaceList.acquire(WorkspaceList.java:236)
at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1399)
at hudson.model.AbstractProject._poll(AbstractProject.java:1376)
at hudson.model.AbstractProject.poll(AbstractProject.java:1287)
at com.tikal.jenkins.plugins.multijob.MultiJobProject.poll(MultiJobProject.java:95)
at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:594)
at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:640)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)Number of locked synchronizers = 1
- java.util.concurrent.ThreadPoolExecutor$Worker@566b1062
At this point if we view the Git Polling Log for the project all we see is
Started on Feb 14, 2018 4:44:59 PM
Is there a way to have polling proceed whilst another build is in progress?
environment
```
OS: Windows x64
Jenkins: 2.89.3
git-client: 2.7.1
scm-api: 2.2.6
jenkins-multijob-plugin: 1.28
```
1 attachment
- [polling-thread-waiting-to-acquire-workspace-lock.png](https://issues.jenkins.io/secure/attachment/41466/polling-thread-waiting-to-acquire-workspace-lock.png)
> 
Contributor guide
Assessment
This issue has not been assessed yet.