jenkinsci / jenkinsci/git-plugin
[JENKINS-59598] Git plugin "Merge before build" option with concurrent build cause git lock issue
- Dominant language
- Java
- Stars
- 694
- Forks
- 1.1k
- Avg merge
- 1h 29m
- Merged PRs (30d)
- 3
Description
The git extension h.p.g.e.PreBuildMerge Merge before build is using master workspace to try merging git branches.
But if executed concurrently this can cause concurrent access to git lock file stderr: fatal: Unable to create '/var/jenkins_home/workspace/pipeline-foo@script/.git/index.lock': File exists.
Quick look at it maybe possible options/ideas:
- mark the extension requiresWorkspaceForPolling
- override change method getWorkingDirectory to return a new directory if context.isConcurrentBuild()
- override decorateCheckoutCommand to use different directory
---
Originally reported by
olamy, imported from: Git plugin "Merge before build" option with concurrent build cause git lock issue
Raw content of original issue
The git extension h.p.g.e.PreBuildMerge Merge before build is using master workspace to try merging git branches.
But if executed concurrently this can cause concurrent access to git lock file stderr: fatal: Unable to create '/var/jenkins_home/workspace/pipeline-foo@script/.git/index.lock': File exists.
Quick look at it maybe possible options/ideas:
- mark the extension requiresWorkspaceForPolling
- override change method getWorkingDirectory to return a new directory if context.isConcurrentBuild()
- override decorateCheckoutCommand to use different directory
Contributor guide
Assessment
This issue has not been assessed yet.