Pull Issue [message #1809872] |
Thu, 25 July 2019 04:01  |
Eclipse User |
|
|
|
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 #1826378 is a reply to message #1826158] |
Fri, 24 April 2020 03:32  |
Eclipse User |
|
|
|
- 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
|
|
|
Powered by
FUDForum. Page generated in 0.07242 seconds