Skip to content

git: Extend locking timeout for packed-refs to decrease contention

Patrick Steinhardt requested to merge pks-git-increase-packed-refs-timeout into master

In high-activity repositories we frequently observe issues with the DeleteRefs() RPC failing. The root cause is typically always the same, namely lock contention around the packed-refs file, because every ref deletion requires us to rewrite that file.

Fortunately, Git already knows that this contention exists and can cause problems. It has thus implemented a timeout mechanism for acquiring lockfiles, which is set to 1 second by default for the packed-refs file. In practice we observe that this timeout is insufficient though for large repositories with high activity.

Bump the timeout to 10 seconds to decrease the chance that locking the packed-refs file fails.

Closes #5160 (closed).

Merge request reports