-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Retry when getting an EOF on HEAD/GET requests because of a Golang bug #41
Conversation
That fix looks safe to me. What do you think about retrying on any error on a HEAD or GET? These requests are idempotent in the swift API so there should be no problems with that. |
this can helps me with my issue when i'm upload file and can't get it back |
@vtolstov probably not since we are just talking about HEAD/GET requests not PUT/POST which would be used to upload data. |
@ncw i'm also have issues in head requests, but file present and after 1,3,5 -10 seconds displayed |
@vtolstov that sounds like it could be swift's eventual consistency in action? Is your swift server very busy? |
@ncw yes, sometimes my swift servers very busy (backends have massive loading by container replicator) |
@ncw Something like :
? |
@lebauce Or maybe even this? resp, err = c.doTimeoutRequest(timer, req)
if err != nil {
if p.Operation == "HEAD" || p.Operation == "GET" {
retries--;
continue
}
return
} |
@ncw Indeed, it's better. I updated the PR |
Thank you very much for that. -- Nick |
When running a 30 minutes testsuite (https://github.com/lebauce/distribution), I faced a weird issue : I sometimes got a url.Error : "Head https://my.swift.server/v1/AUTH_abcdb3abcda34a1c8d618164d99eb53e/test/myobject : EOF". I'm using the 1.4.2 version of Go.
The issue seems to be in the
net/http
library and is described in both tickets :golang/go#4677
golang/go#8946
A fix on
net/http
is under review : https://golang.org/cl/3210A fix for this problem is simply to send the request again when the request was a HEAD or a GET