Skip to content

Commit 8e6fa27

Browse files
authored
Merge pull request #2026 from aws/firstissue
fix #1998 int overflow bug in 32 bit architecture
2 parents 9af2842 + 1ca1e18 commit 8e6fa27

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"id": "f4bce077-53bc-4db9-a6e8-bf18d0b8ce8b",
3+
"type": "bugfix",
4+
"description": "fix int overflow bug on 32 bit architecture",
5+
"modules": [
6+
".",
7+
"service/internal/benchmark"
8+
]
9+
}

aws/retry/jitter_backoff_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestExponentialJitterBackoff_AttemptDelay(t *testing.T) {
3838
"max delay": {
3939
MaxBackoff: 20 * time.Second,
4040
RandFloat: func() (float64, error) { return maxB, nil },
41-
Attempt: 1 << 53,
41+
Attempt: 2147483647,
4242
Expect: timeconv.FloatSecondsDur(maxB * math.Exp2(math.Log2(20))),
4343
},
4444
}

service/internal/benchmark/dynamodb/customizations_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import (
2525

2626
type testData struct {
2727
filename string
28-
respChecksum int
29-
respGzipChecksum int
28+
respChecksum int64
29+
respGzipChecksum int64
3030
}
3131

3232
func BenchmarkCustomizations(b *testing.B) {
@@ -71,7 +71,7 @@ func benchCustomizationsOld(b *testing.B, c testData) {
7171
r.HTTPResponse = &http.Response{
7272
StatusCode: 200,
7373
Header: http.Header{
74-
"X-Amz-Crc32": []string{strconv.Itoa(c.respChecksum)},
74+
"X-Amz-Crc32": []string{strconv.FormatInt(c.respChecksum, 10)},
7575
},
7676
ContentLength: int64(len(body)),
7777
Body: ioutil.NopCloser(bytes.NewReader(body)),
@@ -127,7 +127,7 @@ func benchCustomizationsSmithy(b *testing.B, c testData) {
127127
Region: "us-west-2",
128128
Credentials: unit.StubCredentialsProvider{},
129129
HTTPClient: &mockClient{
130-
ChecksumHeaderValue: []string{strconv.Itoa(c.respChecksum)},
130+
ChecksumHeaderValue: []string{strconv.FormatInt(c.respChecksum, 10)},
131131
ScanRespBody: body,
132132
},
133133
}
@@ -141,7 +141,7 @@ func benchCustomizationsSmithy(b *testing.B, c testData) {
141141
b.Run("all enabled", func(b *testing.B) {
142142
client := dynamodb.New(options, func(o *dynamodb.Options) {
143143
o.HTTPClient = &mockClient{
144-
ChecksumHeaderValue: []string{strconv.Itoa(c.respGzipChecksum)},
144+
ChecksumHeaderValue: []string{strconv.FormatInt(c.respGzipChecksum, 10)},
145145
ScanRespGzipBody: gzipBody,
146146
}
147147
o.DisableValidateResponseChecksum = false

0 commit comments

Comments
 (0)