Skip to content

Commit 2fb345a

Browse files
authored
gitindex: disable git cat-file optimization by default (#1038)
In our production sourcegraph.com cluster we are regularly seeing git grow to over 9GB in size leading to OOMs. Once we disabled this flag the OOMs went away. For now lets default this feature to off until it is resolved.
1 parent 817f975 commit 2fb345a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

gitindex/index.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,11 @@ func indexGitRepo(opts Options, config gitIndexConfig) (bool, error) {
619619
// for the main repo so we can stream them via git cat-file --batch.
620620
// ZOEKT_DISABLE_CATFILE_BATCH=true falls back to the go-git path for
621621
// all files, useful as a kill switch if the cat-file path causes issues.
622-
catfileBatchDisabled := cmp.Or(os.Getenv("ZOEKT_DISABLE_CATFILE_BATCH"), "false")
622+
//
623+
// 2026-04-02(keegan) we are regularly seeing git growing to over 9GB in
624+
// memory usage in our production cluster. Disabling by default until the
625+
// issue is resolved.
626+
catfileBatchDisabled := cmp.Or(os.Getenv("ZOEKT_DISABLE_CATFILE_BATCH"), "true")
623627
useCatfileBatch := true
624628
if disabled, _ := strconv.ParseBool(catfileBatchDisabled); disabled {
625629
useCatfileBatch = false

0 commit comments

Comments
 (0)