-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/http2: under load, Go GCS library or http2 sends bad MIME, gets 400 response with body: "Invalid multipart request with 0 mime parts" #30693
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
Comments
Can you share the output of GODEBUG=http2debug=2? |
(be sure to redact any credentials) Or email it to me privately. This username at golang org. |
Thanks for the email. I extracted out one of the failures from the 163M log.
Looks like the boundary delimiter is declared to be I'm not sure what's causing that, though. It looks like the code responsible for generating that multipart message is https://github.com/googleapis/google-api-go-client/blob/ed2534c57ed076df43af394869d83ac66b040e17/gensupport/media.go#L118 but I don't see anything wrong with that code. As for Go 1.11 vs Go 1.12, I can't think of anything in mime/multipart, net/http, or x/net/http2 that would've changed behavior here. There was a629399 for mime/multipart but I don't see any quoted boundaries here anyway, and I don't think anybody is calling the mime/multipart.Writer.SetBoundary method anyway. You're sure you're not able to reproduce it with Go 1.11 but are with Go 1.12? Hopefully it's not a race within x/net/http2, sending the wrong headers from a different request. That'd scare & surprise me if so. Can you try running it under the Go race detector and see if there are any errors? Your repro code looks fine. /cc @fraenkel |
Also cc @jadekler @jba @zombiezen on the Go Cloud side. |
I tried running it under the Go race detector and it didn't print any errors. I'm sure this isn't reproducible with go 1.11. |
@bradfitz Given that the request had a mismatch on boundary, was there a request in the log that had matching data or a matching header? |
@fraenkel, great question. I just looked. Both those strings above only occurred in the exchange as quoted. And it looks the same in the other failure. (I just noticed the 163M log only has two 400s.) |
I think I see the issue, but I could be mistaken. |
Different user reported the same thing: googleapis/google-cloud-go#1350 |
Dup of googleapis/google-api-go-client#343 I have a fix I'm sending there. |
And fix the test that was trying to catch this case but was failing due to its always-returns-zeros rand fake. The corrected test now fails without the fix and passes with it. Thanks to Michael Fraenkel for identifying the problem. Fixes #343 Fixes googleapis/google-cloud-go#1350 Fixes golang/go#30693 Change-Id: If4251facebbbbeb9f1e169845d0d3573e871d741 Reviewed-on: https://code-review.googlesource.com/c/google-api-go-client/+/39076 Reviewed-by: Jean de Klerk <deklerk@google.com>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, but not with go1.11
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Created many threads (>=100) which continuously upload objects to a GCS bucket in parallel.
To run the program:
go get cloud.google.com/go/storage
bugrepro.go.zip [edit: also at https://play.golang.org/p/73Qbd4DMpbV ]
What did you expect to see?
No errors.
What did you see instead?
A small number of requests fail with the following error:
googleapi: got HTTP response code 400 with body: Invalid multipart request with 0 mime parts.
These errors do not appear when the program is run with go version go1.11 linux/amd64.
Output from running the provided sample program:
The text was updated successfully, but these errors were encountered: