I need to push some pretty big AOSP repositories to Gerrit. The biggest one is 15.1 GB with a 15GB (.pack) file.They are repositories from a 3rd party which I'm supposed to mirror on my Gerrit server and keep them updated on a regular basis with their origin so I can't modify their size.
I originally attempted to mirror them via ssh but they are extremely slow and take several hours to push just a single repo.
I temporarily set up a very big VM (32 vCPU 128GB RAM) to confirm it was not due to a lack of resources (nobody is using the server other than me at this point) and cpu/ram/disk usage was pretty low.
I ended up pushing things via HTTPS with my regular VM (4 vCPU & 16Gb RAM) and I was able to push the biggest repository in a matter of minutes.
When I thought my problems were gone I tried pushing another big repository (3.4GB) and got the next error
"GnuTLS recv error (-110): The TLS connection was non-properly terminated"
Which I was able to bypass by compiling a git binary with open ssl as described here
https://stackoverflow.com/questions/52529639/gnutls-recv-error-110-the-tls-connection-was-non-properly-terminated#But now I'm getting a
"RPC failed; HTTP 502 curl 22 The requested URL returned error: 502 Bad Gateway"
I attempted to increase the https.postbuffer and run gc before pushing but they didn't help
$git config --global https.postBuffer 524288000
$git gc
I'm using Gerrit's Docker image so I set the initial/max Java heap like this:
JAVA_OPTIONS=-Xms8g -Xmx14g
gerrit.config:
[sshd]
listenAddress = *:29418
waitTimeout = 10m
[core]
packedGitLimit = 7g
[receive]
timeout = 15m
[httpd]
listenUrl = proxy-https://*:80
[auth]
type = OAUTH
gitBasicAuthPolicy = HTTP
Gerri logs:
[2023-11-01T14:01:55.550+09:00] [HTTP POST /a/test/mirror-test-aosp-maincore-cts/git-receive-pack (MY_USER from X.X.X.X)] INFO com.google.gerrit.server.git.MultiProgressMonitor : Processing changes: (\) [CONTEXT ratelimit_period="1 MINUTES [skipped: 3]" ]
[2023-11-01T14:01:56.568+09:00] [HTTP POST /a/test/mirror-test-aosp-maincore-cts/git-receive-pack (MY_USER from X.X.X.X)] WARN org.eclipse.jetty.server.handler.ContextHandler.ROOT : Internal error during receive-pack to /var/gerrit/git/test/mirror-test-aosp-maincore-cts.git
org.eclipse.jetty.io.EofException: Closed
at org.eclipse.jetty.server.HttpOutput.checkWritable(HttpOutput.java:771)
at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:795)
at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
at org.eclipse.jgit.util.TemporaryBuffer.write(TemporaryBuffer.java:129)
at org.eclipse.jgit.transport.SideBandOutputStream.writeBuffer(SideBandOutputStream.java:141)
at org.eclipse.jgit.transport.SideBandOutputStream.flushBuffer(SideBandOutputStream.java:94)
at org.eclipse.jgit.transport.ReceivePack.close(ReceivePack.java:1949)
at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:2192)
at org.eclipse.jgit.http.server.ReceivePackServlet.doPost(ReceivePackServlet.java:167)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jgit.http.server.glue.UrlPipeline$Chain.doFilter(UrlPipeline.java:212)
at com.google.gerrit.httpd.GitOverHttpServlet$ReceiveFilter.doFilter(GitOverHttpServlet.java:634)....
Any advice is much appreciated.