-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/crypto/acme: Client.GetAuthorization should return also Retry-After
value
#22457
Comments
@tnozicka how would you propose for |
@x1ddos A) seems nice but I don't really care that much except for having the value available A) Extend type Authorization struct {
// ...
RetryAfter *time.Duration
} B) Change return type func (c *Client) GetAuthorization(ctx context.Context, url string) (*Authorization, error) {/* ... */}
// to
func (c *Client) GetAuthorization(ctx context.Context, url string) (*Authorization, retryAfter time.Duration, error) {/* ... */} C) Second function if you want to avoid API change func (c *Client) GetAuthorizationWithRetryTime(ctx context.Context, url string) (*Authorization, retryAfter time.Duration, error) {
/* ... */
}
func (c *Client) GetAuthorization(ctx context.Context, url string) (*Authorization, error) {
a, _, err := GetAuthorizationWithRetryTime(ctx, url)
return a, err
} |
Change https://golang.org/cl/109615 mentions this issue: |
There's been some confusion about failed request retries. Rightfully so: some requests are retried, others are not. This change attempts to clarify the issue and unify backoff usage in all Client's methods by introducing a new exported optional field RetryBackoff and adding retry logic where missing. Also, updates golang/go#22457. Change-Id: Ied434edf998d52925a48b6b3b2407d45a6e9d2ee Reviewed-on: https://go-review.googlesource.com/109615 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@tnozicka acme.Client now has Would you now consider this issue fixed? |
Retry-After
valueRetry-After
value
Closing since no response from original reporter. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.1 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/tnozicka/go"
GORACE=""
GOROOT="/home/tnozicka/lib/go"
GOTOOLDIR="/home/tnozicka/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build118198130=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
Request
This function
https://github.com/golang/crypto/blob/541b9d50ad47e36efd8fb423e938e59ff1691f68/acme/acme.go#L355-L369
should return
Retry-After
as is used inhttps://github.com/golang/crypto/blob/541b9d50ad47e36efd8fb423e938e59ff1691f68/acme/acme.go#L415
or there should be similar function that does return it.
I have a work queue and want to know at what time should I re-queue my object and I can't use active waiting as with the former function.
The text was updated successfully, but these errors were encountered: