Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuang-Minh Nguyen <qmnguyen@gitlab.com>2023-07-05 08:29:23 +0300
committerQuang-Minh Nguyen <qmnguyen@gitlab.com>2023-07-05 08:29:23 +0300
commit6a254e9b0f7f4d35bd5f87c6195c49124cfec891 (patch)
tree16879d3962af4e15d7b05358db04470cc935e26f
parent248bddde6352bfc9d315672746ccca52a75e993d (diff)
parent982472e0eacef9c7b43de3ab1f9d8288bd26bbca (diff)
Merge branch 'pks-git-increase-files-ref-lock-timeout' into 'master'
git: Increase locking timeout for loose references See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/6013 Merged-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Approved-by: Justin Tobler <jtobler@gitlab.com> Approved-by: Quang-Minh Nguyen <qmnguyen@gitlab.com> Co-authored-by: Patrick Steinhardt <psteinhardt@gitlab.com>
-rw-r--r--internal/git/command_factory.go5
-rw-r--r--internal/git/command_factory_test.go1
2 files changed, 6 insertions, 0 deletions
diff --git a/internal/git/command_factory.go b/internal/git/command_factory.go
index 09979243f..97cd02ecd 100644
--- a/internal/git/command_factory.go
+++ b/internal/git/command_factory.go
@@ -609,6 +609,11 @@ func (cf *ExecCommandFactory) GlobalConfiguration(ctx context.Context) ([]Config
// comparatively high, context cancellation would still cause us to exit early in
// case the caller doesn't want to wait this long.
{Key: "core.packedRefsTimeout", Value: "10000"},
+ // Similarly, for loose references we bump the limit from 100 milliseconds to 1 second. We aim for a
+ // lower limit here as the locking for loose references is typically a lot more fine-grained. We have
+ // still observed lock contention around them though, but mostly in cases where the host system was
+ // heavily loaded by a storm of incoming RPCs.
+ {Key: "core.filesRefLockTimeout", Value: "1000"},
}
return config, nil
diff --git a/internal/git/command_factory_test.go b/internal/git/command_factory_test.go
index 6e733afc2..158688895 100644
--- a/internal/git/command_factory_test.go
+++ b/internal/git/command_factory_test.go
@@ -613,6 +613,7 @@ func TestExecCommandFactory_config(t *testing.T) {
"core.fsync=objects,derived-metadata,reference",
"core.fsyncmethod=fsync",
"core.packedrefstimeout=10000",
+ "core.filesreflocktimeout=1000",
}
gitCmdFactory := gittest.NewCommandFactory(t, cfg)