@smithy/core 3.39.0 → 3.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist-cjs/submodules/retry/index.browser.js +8 -8
- package/dist-cjs/submodules/retry/index.js +8 -8
- package/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js +2 -2
- package/dist-es/submodules/retry/util-retry/retries-2026-config.js +6 -6
- package/dist-types/submodules/retry/util-retry/retries-2026-config.d.ts +16 -6
- package/dist-types/ts3.4/submodules/retry/util-retry/retries-2026-config.d.ts +16 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.40.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8d835c3: Enable the 2026 standard retry behavior unconditionally. The `SMITHY_NEW_RETRIES_2026` environment variable is no longer read. Standard and adaptive modes now default to a 50 ms base delay for non-throttling errors and a 1 s base delay for throttling errors, retry quota costs of 14 (non-throttling) and 5 (throttling), and apply backoff to long-polling operations when the retry quota is exhausted.
|
|
8
|
+
|
|
3
9
|
## 3.39.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -399,21 +399,21 @@ class DefaultRateLimiter {
|
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
class Retry {
|
|
402
|
-
static v2026 =
|
|
402
|
+
static v2026 = true;
|
|
403
403
|
static delay() {
|
|
404
|
-
return
|
|
404
|
+
return 50;
|
|
405
405
|
}
|
|
406
406
|
static throttlingDelay() {
|
|
407
|
-
return
|
|
407
|
+
return 1_000;
|
|
408
408
|
}
|
|
409
409
|
static cost() {
|
|
410
|
-
return
|
|
410
|
+
return 14;
|
|
411
411
|
}
|
|
412
412
|
static throttlingCost() {
|
|
413
|
-
return
|
|
413
|
+
return 5;
|
|
414
414
|
}
|
|
415
415
|
static modifiedCostType() {
|
|
416
|
-
return
|
|
416
|
+
return "THROTTLING";
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
|
|
@@ -494,7 +494,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
494
494
|
this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
|
|
495
495
|
}
|
|
496
496
|
async acquireInitialRetryToken(retryTokenScope) {
|
|
497
|
-
return new DefaultRetryToken(Retry.delay(), 0, undefined,
|
|
497
|
+
return new DefaultRetryToken(Retry.delay(), 0, undefined, retryTokenScope.includes(":longpoll"));
|
|
498
498
|
}
|
|
499
499
|
async refreshRetryTokenForRetry(token, errorInfo) {
|
|
500
500
|
const maxAttempts = await this.getMaxAttempts();
|
|
@@ -510,7 +510,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
510
510
|
retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
|
|
511
511
|
}
|
|
512
512
|
if (!shouldRetry) {
|
|
513
|
-
const longPollBackoff =
|
|
513
|
+
const longPollBackoff = retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
|
|
514
514
|
if (longPollBackoff > 0) {
|
|
515
515
|
await new Promise((r) => setTimeout(r, longPollBackoff));
|
|
516
516
|
}
|
|
@@ -401,21 +401,21 @@ class DefaultRateLimiter {
|
|
|
401
401
|
}
|
|
402
402
|
|
|
403
403
|
class Retry {
|
|
404
|
-
static v2026 =
|
|
404
|
+
static v2026 = true;
|
|
405
405
|
static delay() {
|
|
406
|
-
return
|
|
406
|
+
return 50;
|
|
407
407
|
}
|
|
408
408
|
static throttlingDelay() {
|
|
409
|
-
return
|
|
409
|
+
return 1_000;
|
|
410
410
|
}
|
|
411
411
|
static cost() {
|
|
412
|
-
return
|
|
412
|
+
return 14;
|
|
413
413
|
}
|
|
414
414
|
static throttlingCost() {
|
|
415
|
-
return
|
|
415
|
+
return 5;
|
|
416
416
|
}
|
|
417
417
|
static modifiedCostType() {
|
|
418
|
-
return
|
|
418
|
+
return "THROTTLING";
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
|
|
@@ -496,7 +496,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
496
496
|
this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
|
|
497
497
|
}
|
|
498
498
|
async acquireInitialRetryToken(retryTokenScope) {
|
|
499
|
-
return new DefaultRetryToken(Retry.delay(), 0, undefined,
|
|
499
|
+
return new DefaultRetryToken(Retry.delay(), 0, undefined, retryTokenScope.includes(":longpoll"));
|
|
500
500
|
}
|
|
501
501
|
async refreshRetryTokenForRetry(token, errorInfo) {
|
|
502
502
|
const maxAttempts = await this.getMaxAttempts();
|
|
@@ -512,7 +512,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
512
512
|
retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
|
|
513
513
|
}
|
|
514
514
|
if (!shouldRetry) {
|
|
515
|
-
const longPollBackoff =
|
|
515
|
+
const longPollBackoff = retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
|
|
516
516
|
if (longPollBackoff > 0) {
|
|
517
517
|
await new Promise((r) => setTimeout(r, longPollBackoff));
|
|
518
518
|
}
|
|
@@ -31,7 +31,7 @@ export class StandardRetryStrategy {
|
|
|
31
31
|
this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
|
|
32
32
|
}
|
|
33
33
|
async acquireInitialRetryToken(retryTokenScope) {
|
|
34
|
-
return new DefaultRetryToken(Retry.delay(), 0, undefined,
|
|
34
|
+
return new DefaultRetryToken(Retry.delay(), 0, undefined, retryTokenScope.includes(":longpoll"));
|
|
35
35
|
}
|
|
36
36
|
async refreshRetryTokenForRetry(token, errorInfo) {
|
|
37
37
|
const maxAttempts = await this.getMaxAttempts();
|
|
@@ -47,7 +47,7 @@ export class StandardRetryStrategy {
|
|
|
47
47
|
retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
|
|
48
48
|
}
|
|
49
49
|
if (!shouldRetry) {
|
|
50
|
-
const longPollBackoff =
|
|
50
|
+
const longPollBackoff = retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
|
|
51
51
|
if (longPollBackoff > 0) {
|
|
52
52
|
await new Promise((r) => setTimeout(r, longPollBackoff));
|
|
53
53
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export class Retry {
|
|
2
|
-
static v2026 =
|
|
2
|
+
static v2026 = true;
|
|
3
3
|
static delay() {
|
|
4
|
-
return
|
|
4
|
+
return 50;
|
|
5
5
|
}
|
|
6
6
|
static throttlingDelay() {
|
|
7
|
-
return
|
|
7
|
+
return 1_000;
|
|
8
8
|
}
|
|
9
9
|
static cost() {
|
|
10
|
-
return
|
|
10
|
+
return 14;
|
|
11
11
|
}
|
|
12
12
|
static throttlingCost() {
|
|
13
|
-
return
|
|
13
|
+
return 5;
|
|
14
14
|
}
|
|
15
15
|
static modifiedCostType() {
|
|
16
|
-
return
|
|
16
|
+
return "THROTTLING";
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Retry parameters used by the standard retry strategy.
|
|
3
|
+
*
|
|
4
|
+
* The public constants in `./constants` keep their earlier values, which the
|
|
5
|
+
* deprecated pre-SRA retry strategy still uses.
|
|
6
|
+
*
|
|
2
7
|
* @internal
|
|
3
8
|
*/
|
|
4
9
|
export declare abstract class Retry {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
static
|
|
10
|
+
/**
|
|
11
|
+
* Always true. Kept because previously published packages read this flag.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated the 2026 retry behavior is always enabled. May be removed in a future major version.
|
|
14
|
+
*/
|
|
15
|
+
static readonly v2026 = true;
|
|
16
|
+
static delay(): number;
|
|
17
|
+
static throttlingDelay(): number;
|
|
18
|
+
static cost(): number;
|
|
19
|
+
static throttlingCost(): number;
|
|
20
|
+
static modifiedCostType(): "THROTTLING";
|
|
11
21
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Retry parameters used by the standard retry strategy.
|
|
3
|
+
*
|
|
4
|
+
* The public constants in `./constants` keep their earlier values, which the
|
|
5
|
+
* deprecated pre-SRA retry strategy still uses.
|
|
6
|
+
*
|
|
2
7
|
* @internal
|
|
3
8
|
*/
|
|
4
9
|
export declare abstract class Retry {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
static
|
|
10
|
+
/**
|
|
11
|
+
* Always true. Kept because previously published packages read this flag.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated the 2026 retry behavior is always enabled. May be removed in a future major version.
|
|
14
|
+
*/
|
|
15
|
+
static readonly v2026 = true;
|
|
16
|
+
static delay(): number;
|
|
17
|
+
static throttlingDelay(): number;
|
|
18
|
+
static cost(): number;
|
|
19
|
+
static throttlingCost(): number;
|
|
20
|
+
static modifiedCostType(): "THROTTLING";
|
|
11
21
|
}
|