Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Pull Issue(Pull taking long time to complete)
Pull Issue [message #1809872] Thu, 25 July 2019 04:01 Go to next message
Eclipse UserFriend
I am using org.eclipse.jgit(vesrion 4.11.0.201803080745-r)in my java application.
If the remote repository is huge then it takes a long time to pull the files in my local repository, around 5-6 minutes.

I already cloned git repository in my local machine. After some times(2-3 hours) I hit pull process it takes a long time to finish the process even though nothing new in the git repo. Once pull is done and again If I hit pull, it works fine.
Clone is also taking time but that is fine because that is huge repo to clone for the first time.

Note: I am using an SSH connection to perform all git operations.

Could you review below code to see pull logic in my application and help me resolve the issue?


FileRepositoryBuilder builder = new FileRepositoryBuilder();
Repository repository =builder.setWorkTree(sourceFolderFile).readEnvironment().build();

Git git = new Git(repository);

git.checkout().setName(branch);

if (config.getGitHubConnectionType().equalsIgnoreCase("ssh")) {
      GitSSHConfigSessionFactory sshSessionFactory = new GitSSHConfigSessionFactory(config.getGitHubPrivateKeyFilePath(),config.getGitHubPassphrase(),String.valueOf(config.getGitStrictHostKeyCheck()));
      SshSessionFactory.setInstance(sshSessionFactory);
     git.pull().setTransportConfigCallback(new TransportConfigCallback() {
            @Override
           public void configure(Transport transport) {
                                        SshTransport sshTransport = (SshTransport) transport;
                                        sshTransport.setSshSessionFactory(sshSessionFactory);
           }
     }).call();
}
Re: Pull Issue [message #1810137 is a reply to message #1809872] Thu, 01 August 2019 04:34 Go to previous messageGo to next message
Eclipse UserFriend
Maybe if you displayed the PullResult that might give you an idea why it sometimes takes long. Maybe it has to pull a lot.

You also seem to be using your own SSH session factory, maybe something is wrong in there.
Re: Pull Issue [message #1826158 is a reply to message #1810137] Mon, 20 April 2020 08:55 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Thomas,
If we updated just 1 file in git remote repository. It also takes much time to finish the pull operation. Even, some times it got stuck for whole day.
Pull should not take more than a minute to pull 1 small file. Repo could be bigger but after cloning pull should not take much time for 1 small file.

If anyone has some idea please put here. I am so fed up with this jgit pull. It's working fine with ndoe git
Re: Pull Issue [message #1826378 is a reply to message #1826158] Fri, 24 April 2020 03:32 Go to previous message
Eclipse UserFriend
- first of all you should update to the latest jgit release 4.11 is pretty outdated and 4.11.0 is not the latest service release for 4.11.x which would be 4.11.8
- git pull involves multiple phases, in the first phase client and server negotiate which objects need to be sent, in the second phase the server creates a pack containing these objects and sends it over to the client which then stores them in the repository, updates the working tree and merges that into the respective local branch. Already the first phase can create considerable load for a large repository. If any of the involved repository has a lot of loose objects or refs (if gc wasn't run for a long time) this could slow down the operation) this comes on top
- which max heap size did you configure on the client side ?
- when the operation is stuck create a thread dump e.g. using jstack, it will reveal where the operation is stuck, post that here and I can have a look
Previous Topic:cloning/fetching repo from an S3-compatible Object Storage
Next Topic:eGIT is throwing NullPointerException
Goto Forum:
  


Current Time: Sun Jul 13 01:12:03 EDT 2025

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

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

Back to the top