jenkinsci / jenkinsci/git-client-plugin

[JENKINS-12513] git plugin should automatically remove .git/index.lock if the job is killed

Open
#1,368 11 comments 0 reactions 0 assignees View on GitHub
component:git-client-plugin imported-jira-issue jira-type:task priority:major resolution:unresolved
Dominant language
Java
Stars
152
Forks
402
Avg merge
6h 47m
Merged PRs (30d)
4

Description

Git will create a .git/index.lock file when it is executing. If the job is killed, the git process is killed, and therefore the lock file is left over. All subsequent attempts to run git in that workspace on that machine will fail.

One solution is to delete this file in the post-build task of the job automatically.

---
Originally reported by bnovc, imported from: git plugin should automatically remove .git/index.lock if the job is killed


  • status: Open
  • priority: Major
  • component(s): git-client-plugin
  • resolution: Unresolved
  • votes: 29
  • watchers: 29
  • imported: 20251211-071809

Raw content of original issue

Git will create a .git/index.lock file when it is executing. If the job is killed, the git process is killed, and therefore the lock file is left over. All subsequent attempts to run git in that workspace on that machine will fail.

One solution is to delete this file in the post-build task of the job automatically.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.