Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
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
What version of Go are you using (
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.
I think I see the issue, but I could be mistaken.
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 <firstname.lastname@example.org>