Skip to content

Commit a7183b1

Browse files
authored
Update retryablehttp to fix a data race (hashicorp#9551)
1 parent f4bbf62 commit a7183b1

File tree

9 files changed

+163
-59
lines changed

9 files changed

+163
-59
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ require (
6060
github.com/hashicorp/go-msgpack v0.5.5
6161
github.com/hashicorp/go-multierror v1.1.0
6262
github.com/hashicorp/go-raftchunking v0.6.3-0.20191002164813-7e9e8525653a
63-
github.com/hashicorp/go-retryablehttp v0.6.6
63+
github.com/hashicorp/go-retryablehttp v0.6.7
6464
github.com/hashicorp/go-rootcerts v1.0.2
6565
github.com/hashicorp/go-sockaddr v1.0.2
6666
github.com/hashicorp/go-syslog v1.0.0

go.sum

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
374374
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
375375
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
376376
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
377+
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
377378
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
378379
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
379380
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
@@ -486,6 +487,12 @@ github.com/hashicorp/go-retryablehttp v0.6.2 h1:bHM2aVXwBtBJWxHtkSrWuI4umABCUczs
486487
github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY=
487488
github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM=
488489
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
490+
github.com/hashicorp/go-retryablehttp v0.6.7-0.20200721161721-0321369f5ae5 h1:5TSzdrlZZIR4v20yFQ27rfIqpJqDHlQxBZSdbcpVJ4E=
491+
github.com/hashicorp/go-retryablehttp v0.6.7-0.20200721161721-0321369f5ae5/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
492+
github.com/hashicorp/go-retryablehttp v0.6.7-0.20200807182356-37b3e74def02 h1:ge34nim2FF6+u3uWkQX7QvLBgucVCIqIUfa0i3dGX/g=
493+
github.com/hashicorp/go-retryablehttp v0.6.7-0.20200807182356-37b3e74def02/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
494+
github.com/hashicorp/go-retryablehttp v0.6.7 h1:8/CAEZt/+F7kR7GevNHulKkUjLht3CPmn7egmhieNKo=
495+
github.com/hashicorp/go-retryablehttp v0.6.7/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
489496
github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
490497
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
491498
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=

http/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func rateLimitQuotaWrapping(handler http.Handler, core *vault.Core) http.Handler
7171
respondError(w, http.StatusTooManyRequests, quotaErr)
7272

7373
if core.Logger().IsTrace() {
74-
core.Logger().Trace("request rejected due to lease count quota violation", "request_path", path)
74+
core.Logger().Trace("request rejected due to rate limit quota violation", "request_path", path)
7575
}
7676

7777
if core.RateLimitAuditLoggingEnabled() {

serviceregistration/kubernetes/client/client_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package client
22

33
import (
4+
"errors"
45
"os"
56
"testing"
67

@@ -56,8 +57,11 @@ func (e *env) TestGetPodNotFound(t *testing.T) {
5657
if err == nil {
5758
t.Fatal("expected error because pod is unfound")
5859
}
60+
if wrapped := errors.Unwrap(err); wrapped != nil {
61+
err = wrapped
62+
}
5963
if _, ok := err.(*ErrNotFound); !ok {
60-
t.Fatalf("expected *ErrNotFound but received %T", err)
64+
t.Fatalf("expected *ErrNotFound but received %T (%s)", err, err)
6165
}
6266
}
6367

@@ -89,6 +93,9 @@ func (e *env) TestUpdatePodTagsNotFound(t *testing.T) {
8993
if err == nil {
9094
t.Fatal("expected error because pod is unfound")
9195
}
96+
if wrapped := errors.Unwrap(err); wrapped != nil {
97+
err = wrapped
98+
}
9299
if _, ok := err.(*ErrNotFound); !ok {
93100
t.Fatalf("expected *ErrNotFound but received %T", err)
94101
}

vault/external_tests/quotas/quotas_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func TestQuotas_RateLimitQuota_Mount(t *testing.T) {
236236

237237
// update the rate limit quota with a high RPS such that no requests should fail
238238
_, err = client.Logical().Write("sys/quotas/rate-limit/rlq", map[string]interface{}{
239-
"rate": 1000.0,
239+
"rate": 10000.0,
240240
"path": "pki/",
241241
})
242242
if err != nil {
@@ -400,7 +400,7 @@ func TestQuotas_RateLimitQuota(t *testing.T) {
400400

401401
// update the rate limit quota with a high RPS such that no requests should fail
402402
_, err = client.Logical().Write("sys/quotas/rate-limit/rlq", map[string]interface{}{
403-
"rate": 1000.0,
403+
"rate": 10000.0,
404404
})
405405
if err != nil {
406406
t.Fatal(err)

vendor/github.com/hashicorp/go-retryablehttp/.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)