[solved]JGIT Push takes a long time to add an empty commit (no changes) when executed from cloud [message #1858798] |
Sat, 22 April 2023 15:58  |
Eclipse User |
|
|
|
Hello everyone and beware the ask is fuzzy and I would not have posted it here, but I'm really puzzled.
Context: I'm using JGIT 6.5.202303070854-r in a custom application that runs as a plugin inside another Java app inside Tomcat. For all intents and purposes it's a normal Java implementation. The end result is that methods like Push and Pull are exposed as webservices
Behavior: When this plugin is deployed in a cloud environment (which means the host app is deployed in a kubernetes architecture) what I observed is that even if Pull executes relatively ok, Push on the other hand executes very slow, making the webservice request timing out (socket timeout exception (read timeout)).
What I tried: The same Push in my own local Tomcat instance executes in 5-6 seconds, while in cloud I sat once 15 minutes and it was still executing.I observed that essentially the commit is being pushed successfully with all its content, as far as I checked (though I did not do a binary check on the file count/contents) All the tests I did were with empty commits and with a 22MB repo with 532 files with 5 commits. I did observe that during the execution time, I have the following error: ".git/refs/remotes/origin/.probe-99c3f223-6a2c-4535-8c39-0c34f8f44ff6: Operation not permitted" issued from JGit-FileStoreAttributeReader-2 (the thread name). However this error does not happen all the time - last time the service executed successfully but in 5,8 minutes without any error.
I am currently in the process of retrieving the Kubernetes node logs to see if there's anything there that might point to this, but if anyone encountered this I would be grateful to understand why that happens.
The Push implementation is this, in case it matters, wrapper in a try/catch: `
myGitFolder.add().addFilepattern(".").setUpdate(true).call();
myGitFolder.commit().setAll(true).setMessage(Message).setCommitter(str_CommitterName, str_CommitterEmail).call();
CredentialsProvider credentialsProvider = new UsernamePasswordCredentialsProvider(str_User, str_Password);
Iterable<PushResult> prList = myGitFolder.push().setRemote("origin")
.setCredentialsProvider(credentialsProvider).call();
`
I'm also in the process of creating a Java disk performance benchmark (not something very complex) to look at the disk read performance first, then other metrics, like file access time (?) since I suspect the Azure storage account might have some limitations.
Expectation: I'm expecting to have Push with the above implementation execute in under 10 seconds with an empty commit.
Question: since JGit does not seem to have internal TRACE logging I can active, I feel to ask very blindly if anyone has seen this kind of behavior in an infrastructure like mine (cloud).
I suspect the Azure storage account that persists the Git repository files has some sort of limitations (I'm not good with Azure, just aware). But, even with that, it seems that for 500 files jgit should not spend 15 minutes to push an empty commit. HTTP request speed does not seem to be the culprit, since pull works fast.
[Updated on: Mon, 08 May 2023 09:59] by Moderator
|
|
|
|
|
|
|
|
|
Re: JGIT Push takes a long time to add an empty commit (no changes) when executed from a Cloud syste [message #1859006 is a reply to message #1858848] |
Fri, 05 May 2023 06:51  |
Eclipse User |
|
|
|
Here's an update for whoever hits this issue in the future.
The slowness exhibited in my case is due to three compound aspects:
- the frequent file read/write operations executed by the Java JGIT library when pushing data (even with an empty commit)
- a large file count (started being visible after 80 files per repo)
- use of Azure Files for file persistence in the kubernetes architecture my app is hosted. They mention this issue here.
I performed a lot of tests, and if anyone would like to have a deep dive, please ping me with DM to discuss - simply too much to share here.
[Updated on: Fri, 05 May 2023 06:54] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.06548 seconds