Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/review/git-codereview, gerrit: CL submission hangs #30905

Closed
acln0 opened this issue Mar 18, 2019 · 9 comments
Closed

x/review/git-codereview, gerrit: CL submission hangs #30905

acln0 opened this issue Mar 18, 2019 · 9 comments

Comments

@acln0
Copy link
Contributor

acln0 commented Mar 18, 2019

I am unable to submit a CL to the sys repository. Shell transcript:

: forge:perf $ git codereview mail -v
git rev-parse --abbrev-ref HEAD # 0.004s
git rev-parse HEAD # 0.003s
git log --topo-order --format=format:%H%x00%h%x00%P%x00%B%x00%s%x00 origin/master..refs/heads/perf -- # 0.005s
git diff --name-only a2f829d7f35f2ed1c3520c553a6226495455cae0 93747d5203d7bdac69d93ca2eb7e4cd0d12d4477 -- # 0.004s
git diff --name-only a2f829d7f35f2ed1c3520c553a6226495455cae0 93747d5203d7bdac69d93ca2eb7e4cd0d12d4477 -- # 0.004s
git status -b --porcelain # 0.004s
git config remote.origin.url # 0.001s
# hangs
^C
: forge:perf $ git push -v origin HEAD:refs/for/master
Pushing to https://go.googlesource.com/sys
Enumerating objects: 20, done.
Counting objects: 100% (20/20), done.
Delta compression using up to 4 threads
Compressing objects: 100% (17/17), done.
Writing objects: 100% (17/17), 42.11 KiB | 1.68 MiB/s, done.
Total 17 (delta 3), reused 0 (delta 0)
POST git-receive-pack (43272 bytes)
# hangs
^C

I am otherwise able to reach go.googlesource.com, as well as the gerrit dashboards.

@dmitshur
Copy link
Contributor

Does the problem persist even now, if you try again?

@acln0
Copy link
Contributor Author

acln0 commented Mar 19, 2019

@dmitshur Yes. I tried resetting my gerrit cookie too, but to no avail.

I wonder if there's anything wrong with the CL itself. It's rather large, but it doesn't contain any binaries or anything of the kind. Is there any extra information I could give that would help debug this?

@acln0
Copy link
Contributor Author

acln0 commented Mar 19, 2019

I was able to make it work just now, by forcing git to use chunked mode when speaking HTTP. I set git config http.postBuffer 1024, which resulted in a POST git-receive-pack (chunked) rather than the previous POST git-receive-pack (43272 bytes). The gerrit server seemed to like this more.

@acln0
Copy link
Contributor Author

acln0 commented Mar 19, 2019

Please feel free to close this bug if there is nothing else to discuss.

@mikioh mikioh changed the title gerrit: CL submission hangs x/review/git-codereview, gerrit: CL submission hangs Mar 19, 2019
@gopherbot gopherbot added this to the Unreleased milestone Mar 19, 2019
@mikioh
Copy link
Contributor

mikioh commented Mar 19, 2019

Perhaps, this might be an issue of git transport, for example, TLS alert protocol handling (usually close_notify) in git transport; GnuTLS or OpenSSL+variants.

@mvdan
Copy link
Member

mvdan commented Mar 20, 2019

Perhaps related - I just had an issue where git-codereview mail -trybot was using an entire CPU core on my laptop. top said it was a process called git-remote-http. The command I was running showed nothing. I rebuilt git-codereview, and now it works fine. It got stuck spinning the CPU three times in a row that I tried, before rebuilding the tool.

@agnivade
Copy link
Contributor

@acln0 - It is unclear to me how your workaround solved the issue.

According to the man page (https://git-scm.com/docs/git-config#Documentation/git-config.txt-httppostBuffer)

Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.

So it seems that git automatically uses chunked encoding if the buffer size is larger than 1MiB. And you further reduced the buffer size to 1KB to force chunked encoding always ? But that will mean, if the default is kept to 1MB, then any POST requests to gerrit of size more than 1KB will fail, which seems a bit unlikely.

Gerrit was having issues lately which have been resolved. Would you be willing to give another try by resetting the postBuffer to its default value ?

@acln0
Copy link
Contributor Author

acln0 commented Mar 26, 2019

It is unclear to me how your workaround solved the issue.

It is unclear to me as well. While searching for "POST git-receive-pack hang" or similar terms, I noticed that people who were reporting such issues had a mix of chunked and non-chunked transfer encodings. I was getting a non-chunked transfer, so I thought I should try forcing a chunked transfer encoding, to see if that solves the hang. Whether it solved it by coincidence or by some other factors, I do not know, but I was able to submit the CL. There is no fundamental theory behind the 1KiB number I used either: I wanted something smaller than the size of my pack, which was 43272 bytes.

Would you be willing to give another try by resetting the postBuffer to its default value ?

I was able to send the large CL I was talking about before, and I don't have another large CL to send right now. All my interactions with Gerrit in the meantime have worked just fine.


@agnivade Sorry for the late response. I know this message isn't very helpful, and I'm sorry about that, but I don't see what other details I can give at this point, or what else I could try. Maybe this bug should be closed for now.

@agnivade
Copy link
Contributor

Alright, let's reopen this if it crops up again. Thanks for the update.

@golang golang locked and limited conversation to collaborators Mar 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants