Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » autogc (async operations in JGit-WorkQueue)
autogc [message #1851202] Wed, 30 March 2022 13:06
David Cerbino is currently offline David CerbinoFriend
Messages: 1
Registered: March 2022
Junior Member
Hello.
I'm working on a spring boot project that uses jgit (version 6.1.0.202203080745-r) to fetch remote repo to a local network dir inside a Kubernetes environment.
We have many pods where we implement our API.
We are seeing some errors in the JGit-WorkQueue thread like this:
Exception caught while accessing pack file /.../objects/pack/pack-db627c1a19af5a52f2f17c1934f89e4c894f3073.pack, the pack file might be corrupt. Caught 1 consecutive errors while trying to read this pack.


Investigating the issues and watching the entire stack trace I've discovered that this is not happening on our code and it is basically the GC that sometimes is triggered by jgit while other pods are accessing the repo.
So I've tried to totally disable the auto gc initializing with git a file in /etc/gitconfig like this:
[gc]
	auto = 0
	autoPackLimit = 0
	autoDetach = false


using the following command in the Dockerfile:
RUN (git config --system gc.auto 0 && git config --system gc.autoPackLimit 0 && git config --system gc.autoDetach false)


Anyway, I still see this error each 3 hr more or less.
I've even tried to inizilize jgit using a code like this in the bean that implements git operations:
    private void loadConfig() {
        SystemReader configReader = SystemReader.getInstance();
        try {
            StoredConfig systemConfig = configReader.getSystemConfig();
            log.info("loading jgit system config: {}", systemConfig);
            systemConfig.load();
        }
        catch (IOException | ConfigInvalidException e) {
            log.error("error while loading jgit system config", e);
        }

        try {
            StoredConfig userConfig = configReader.getUserConfig();
            log.info("loading jgit user config: {}", userConfig);
            userConfig.load();
        }
        catch (IOException | ConfigInvalidException e) {
            log.error("error while loading jgit user config", e);
        }
    }

the log shows that effectively the configuration is loaded.
Can someone help me to troubleshoot this?
Is there any way to use the fetch command disabling autogc?
Em I missing something:?

PS
We have a cronjob that does the GC on each repository so we basically do not need autogc even because the autogc does not lock the repo to avoid concurrent access tries.
Previous Topic:While Cloning the Git LFS Repository getting error
Next Topic:Idiomatic way to check for bare repos while cloning
Goto Forum:
  


Current Time: Mon Sep 26 10:50:37 GMT 2022

Powered by FUDForum. Page generated in 0.01484 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top