@fluidframework/driver-utils 2.0.0-internal.2.3.0 → 2.0.0-internal.2.4.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/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/runWithRetry.d.ts.map +1 -1
- package/dist/runWithRetry.js +10 -0
- package/dist/runWithRetry.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/runWithRetry.d.ts.map +1 -1
- package/lib/runWithRetry.js +10 -0
- package/lib/runWithRetry.js.map +1 -1
- package/package.json +32 -10
- package/src/packageVersion.ts +1 -1
- package/src/runWithRetry.ts +11 -0
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/driver-utils";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.2.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.2.4.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/driver-utils";
|
|
11
|
-
exports.pkgVersion = "2.0.0-internal.2.
|
|
11
|
+
exports.pkgVersion = "2.0.0-internal.2.4.0";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.0.0-internal.2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.0.0-internal.2.4.0\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runWithRetry.d.ts","sourceRoot":"","sources":["../src/runWithRetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAOtE;;;GAGG;AACH,MAAM,WAAW,SAAS;IACtB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;;;;OAOG;IACH,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;CACjD;AAED,wBAAsB,YAAY,CAAC,CAAC,EAChC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,EACzC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,SAAS,GACpB,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"runWithRetry.d.ts","sourceRoot":"","sources":["../src/runWithRetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAOtE;;;GAGG;AACH,MAAM,WAAW,SAAS;IACtB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;;;;OAOG;IACH,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;CACjD;AAED,wBAAsB,YAAY,CAAC,CAAC,EAChC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,EACzC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,SAAS,GACpB,OAAO,CAAC,CAAC,CAAC,CAsEZ"}
|
package/dist/runWithRetry.js
CHANGED
|
@@ -43,6 +43,16 @@ async function runWithRetry(api, fetchCallName, logger, progress) {
|
|
|
43
43
|
}, err);
|
|
44
44
|
throw new _1.NonRetryableError("runWithRetry was Aborted", driver_definitions_1.DriverErrorType.genericError, { driverVersion: packageVersion_1.pkgVersion, fetchCallName });
|
|
45
45
|
}
|
|
46
|
+
// logging the first failed retry instead of every attempt. We want to avoid filling telemetry
|
|
47
|
+
// when we have tight loop of retrying in offline mode, but we also want to know what caused
|
|
48
|
+
// the failure in the first place
|
|
49
|
+
if (numRetries === 0) {
|
|
50
|
+
logger.sendTelemetryEvent({
|
|
51
|
+
eventName: `${fetchCallName}_firstFailed`,
|
|
52
|
+
duration: common_utils_1.performance.now() - startTime,
|
|
53
|
+
fetchCallName,
|
|
54
|
+
}, err);
|
|
55
|
+
}
|
|
46
56
|
numRetries++;
|
|
47
57
|
lastError = err;
|
|
48
58
|
// If the error is throttling error, then wait for the specified time before retrying.
|
package/dist/runWithRetry.js.map
CHANGED
|
@@ -1 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sF;YACtF,0FAA0F;YAC1F,YAAY,GAAG,MAAA,IAAA,gCAAsB,EAAC,GAAG,CAAC,mCAAI,IAAI,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;YAC/E,IAAI,QAAQ,CAAC,OAAO,EAAE;gBAClB,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;aACvC;YACD,MAAM,IAAA,oBAAK,EAAC,YAAY,CAAC,CAAC;SAC7B;KACJ,QAAQ,CAAC,OAAO,EAAE;IACnB,IAAI,UAAU,GAAG,CAAC,EAAE;QAChB,MAAM,CAAC,kBAAkB,CAAC;YACtB,SAAS,EAAE,GAAG,aAAa,YAAY;YACvC,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,0BAAW,CAAC,GAAG,EAAE,GAAG,SAAS;YACvC,aAAa;SAChB,EACD,SAAS,CAAC,CAAC;KACd;IACD,oEAAoE;IACpE,OAAO,MAAO,CAAC;AACnB,CAAC;AA3ED,oCA2EC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { delay, performance } from \"@fluidframework/common-utils\";\nimport { DriverErrorType } from \"@fluidframework/driver-definitions\";\nimport { canRetryOnError, getRetryDelayFromError } from \"./network\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { NonRetryableError } from \".\";\n\n/**\n * Interface describing an object passed to various network APIs.\n * It allows caller to control cancellation, as well as learn about any delays.\n */\nexport interface IProgress {\n /**\n * Abort signal used to cancel operation.\n *\n * @remarks Note that most of the layers do not use this signal yet. We need to change that over time.\n * Please consult with API documentation / implementation.\n * Note that number of layers may not check this signal while holding this request in a queue,\n * so it may take a while it takes effect. This can be improved in the future.\n *\n * The layers in question are:\n *\n * - driver (RateLimiter)\n *\n * - runWithRetry\n */\n cancel?: AbortSignal;\n\n /**\n * Called whenever api returns cancellable error and the call is going to be retried.\n * Any exception thrown from this call back result in cancellation of operation\n * and propagation of thrown exception.\n * @param delayInMs - delay before next retry. This value will depend on internal back-off logic,\n * as well as information provided by service (like 429 error asking to wait for some time before retry)\n * @param error - error object returned from the call.\n */\n onRetry?(delayInMs: number, error: any): void;\n}\n\nexport async function runWithRetry<T>(\n api: (cancel?: AbortSignal) => Promise<T>,\n fetchCallName: string,\n logger: ITelemetryLogger,\n progress: IProgress,\n): Promise<T> {\n let result: T | undefined;\n let success = false;\n let retryAfterMs = 1000; // has to be positive!\n let numRetries = 0;\n const startTime = performance.now();\n let lastError: any;\n do {\n try {\n result = await api(progress.cancel);\n success = true;\n } catch (err) {\n // If it is not retriable, then just throw the error.\n if (!canRetryOnError(err)) {\n logger.sendTelemetryEvent({\n eventName: `${fetchCallName}_cancel`,\n retry: numRetries,\n duration: performance.now() - startTime,\n fetchCallName,\n }, err);\n throw err;\n }\n\n if (progress.cancel?.aborted === true) {\n logger.sendTelemetryEvent({\n eventName: `${fetchCallName}_runWithRetryAborted`,\n retry: numRetries,\n duration: performance.now() - startTime,\n fetchCallName,\n }, err);\n throw new NonRetryableError(\n \"runWithRetry was Aborted\",\n DriverErrorType.genericError,\n { driverVersion: pkgVersion, fetchCallName },\n );\n }\n\n // logging the first failed retry instead of every attempt. We want to avoid filling telemetry\n // when we have tight loop of retrying in offline mode, but we also want to know what caused\n // the failure in the first place\n if(numRetries === 0) {\n logger.sendTelemetryEvent({\n eventName: `${fetchCallName}_firstFailed`,\n duration: performance.now() - startTime,\n fetchCallName,\n }, err);\n }\n\n numRetries++;\n lastError = err;\n // If the error is throttling error, then wait for the specified time before retrying.\n // If the waitTime is not specified, then we start with retrying immediately to max of 8s.\n retryAfterMs = getRetryDelayFromError(err) ?? Math.min(retryAfterMs * 2, 8000);\n if (progress.onRetry) {\n progress.onRetry(retryAfterMs, err);\n }\n await delay(retryAfterMs);\n }\n } while (!success);\n if (numRetries > 0) {\n logger.sendTelemetryEvent({\n eventName: `${fetchCallName}_lastError`,\n retry: numRetries,\n duration: performance.now() - startTime,\n fetchCallName,\n },\n lastError);\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return result!;\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/driver-utils";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-internal.2.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.2.4.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluidframework/driver-utils";
|
|
8
|
-
export const pkgVersion = "2.0.0-internal.2.
|
|
8
|
+
export const pkgVersion = "2.0.0-internal.2.4.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.0.0-internal.2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.0.0-internal.2.4.0\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runWithRetry.d.ts","sourceRoot":"","sources":["../src/runWithRetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAOtE;;;GAGG;AACH,MAAM,WAAW,SAAS;IACtB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;;;;OAOG;IACH,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;CACjD;AAED,wBAAsB,YAAY,CAAC,CAAC,EAChC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,EACzC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,SAAS,GACpB,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"runWithRetry.d.ts","sourceRoot":"","sources":["../src/runWithRetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAOtE;;;GAGG;AACH,MAAM,WAAW,SAAS;IACtB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;;;;OAOG;IACH,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;CACjD;AAED,wBAAsB,YAAY,CAAC,CAAC,EAChC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,EACzC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,SAAS,GACpB,OAAO,CAAC,CAAC,CAAC,CAsEZ"}
|
package/lib/runWithRetry.js
CHANGED
|
@@ -40,6 +40,16 @@ export async function runWithRetry(api, fetchCallName, logger, progress) {
|
|
|
40
40
|
}, err);
|
|
41
41
|
throw new NonRetryableError("runWithRetry was Aborted", DriverErrorType.genericError, { driverVersion: pkgVersion, fetchCallName });
|
|
42
42
|
}
|
|
43
|
+
// logging the first failed retry instead of every attempt. We want to avoid filling telemetry
|
|
44
|
+
// when we have tight loop of retrying in offline mode, but we also want to know what caused
|
|
45
|
+
// the failure in the first place
|
|
46
|
+
if (numRetries === 0) {
|
|
47
|
+
logger.sendTelemetryEvent({
|
|
48
|
+
eventName: `${fetchCallName}_firstFailed`,
|
|
49
|
+
duration: performance.now() - startTime,
|
|
50
|
+
fetchCallName,
|
|
51
|
+
}, err);
|
|
52
|
+
}
|
|
43
53
|
numRetries++;
|
|
44
54
|
lastError = err;
|
|
45
55
|
// If the error is throttling error, then wait for the specified time before retrying.
|
package/lib/runWithRetry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runWithRetry.js","sourceRoot":"","sources":["../src/runWithRetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,GAAG,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FAAsF;YACtF,0FAA0F;YAC1F,YAAY,GAAG,MAAA,sBAAsB,CAAC,GAAG,CAAC,mCAAI,IAAI,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;YAC/E,IAAI,QAAQ,CAAC,OAAO,EAAE;gBAClB,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;aACvC;YACD,MAAM,KAAK,CAAC,YAAY,CAAC,CAAC;SAC7B;KACJ,QAAQ,CAAC,OAAO,EAAE;IACnB,IAAI,UAAU,GAAG,CAAC,EAAE;QAChB,MAAM,CAAC,kBAAkB,CAAC;YACtB,SAAS,EAAE,GAAG,aAAa,YAAY;YACvC,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS;YACvC,aAAa;SAChB,EACD,SAAS,CAAC,CAAC;KACd;IACD,oEAAoE;IACpE,OAAO,MAAO,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { delay, performance } from \"@fluidframework/common-utils\";\nimport { DriverErrorType } from \"@fluidframework/driver-definitions\";\nimport { canRetryOnError, getRetryDelayFromError } from \"./network\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { NonRetryableError } from \".\";\n\n/**\n * Interface describing an object passed to various network APIs.\n * It allows caller to control cancellation, as well as learn about any delays.\n */\nexport interface IProgress {\n /**\n * Abort signal used to cancel operation.\n *\n * @remarks Note that most of the layers do not use this signal yet. We need to change that over time.\n * Please consult with API documentation / implementation.\n * Note that number of layers may not check this signal while holding this request in a queue,\n * so it may take a while it takes effect. This can be improved in the future.\n *\n * The layers in question are:\n *\n * - driver (RateLimiter)\n *\n * - runWithRetry\n */\n cancel?: AbortSignal;\n\n /**\n * Called whenever api returns cancellable error and the call is going to be retried.\n * Any exception thrown from this call back result in cancellation of operation\n * and propagation of thrown exception.\n * @param delayInMs - delay before next retry. This value will depend on internal back-off logic,\n * as well as information provided by service (like 429 error asking to wait for some time before retry)\n * @param error - error object returned from the call.\n */\n onRetry?(delayInMs: number, error: any): void;\n}\n\nexport async function runWithRetry<T>(\n api: (cancel?: AbortSignal) => Promise<T>,\n fetchCallName: string,\n logger: ITelemetryLogger,\n progress: IProgress,\n): Promise<T> {\n let result: T | undefined;\n let success = false;\n let retryAfterMs = 1000; // has to be positive!\n let numRetries = 0;\n const startTime = performance.now();\n let lastError: any;\n do {\n try {\n result = await api(progress.cancel);\n success = true;\n } catch (err) {\n // If it is not retriable, then just throw the error.\n if (!canRetryOnError(err)) {\n logger.sendTelemetryEvent({\n eventName: `${fetchCallName}_cancel`,\n retry: numRetries,\n duration: performance.now() - startTime,\n fetchCallName,\n }, err);\n throw err;\n }\n\n if (progress.cancel?.aborted === true) {\n logger.sendTelemetryEvent({\n eventName: `${fetchCallName}_runWithRetryAborted`,\n retry: numRetries,\n duration: performance.now() - startTime,\n fetchCallName,\n }, err);\n throw new NonRetryableError(\n \"runWithRetry was Aborted\",\n DriverErrorType.genericError,\n { driverVersion: pkgVersion, fetchCallName },\n );\n }\n\n numRetries++;\n lastError = err;\n // If the error is throttling error, then wait for the specified time before retrying.\n // If the waitTime is not specified, then we start with retrying immediately to max of 8s.\n retryAfterMs = getRetryDelayFromError(err) ?? Math.min(retryAfterMs * 2, 8000);\n if (progress.onRetry) {\n progress.onRetry(retryAfterMs, err);\n }\n await delay(retryAfterMs);\n }\n } while (!success);\n if (numRetries > 0) {\n logger.sendTelemetryEvent({\n eventName: `${fetchCallName}_lastError`,\n retry: numRetries,\n duration: performance.now() - startTime,\n fetchCallName,\n },\n lastError);\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return result!;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runWithRetry.js","sourceRoot":"","sources":["../src/runWithRetry.ts"],"names":[],"mappings":"AAAA;;;GAGG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WAAW,CAAC,GAAG,EAAE,GAAG,SAAS;oBACvC,aAAa;iBAChB,EAAE,GAAG,CAAC,CAAC;gBACR,MAAM,IAAI,iBAAiB,CACvB,0BAA0B,EAC1B,eAAe,CAAC,YAAY,EAC5B,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,CAC/C,CAAC;aACL;YAED,8FAA8F;YAC9F,4FAA4F;YAC5F,iCAAiC;YACjC,IAAG,UAAU,KAAK,CAAC,EAAE;gBACjB,MAAM,CAAC,kBAAkB,CAAC;oBACtB,SAAS,EAAE,GAAG,aAAa,cAAc;oBACzC,QAAQ,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS;oBACvC,aAAa;iBAChB,EAAE,GAAG,CAAC,CAAC;aACX;YAED,UAAU,EAAE,CAAC;YACb,SAAS,GAAG,GAAG,CAAC;YAChB,sFAAsF;YACtF,0FAA0F;YAC1F,YAAY,GAAG,MAAA,sBAAsB,CAAC,GAAG,CAAC,mCAAI,IAAI,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;YAC/E,IAAI,QAAQ,CAAC,OAAO,EAAE;gBAClB,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;aACvC;YACD,MAAM,KAAK,CAAC,YAAY,CAAC,CAAC;SAC7B;KACJ,QAAQ,CAAC,OAAO,EAAE;IACnB,IAAI,UAAU,GAAG,CAAC,EAAE;QAChB,MAAM,CAAC,kBAAkB,CAAC;YACtB,SAAS,EAAE,GAAG,aAAa,YAAY;YACvC,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS;YACvC,aAAa;SAChB,EACD,SAAS,CAAC,CAAC;KACd;IACD,oEAAoE;IACpE,OAAO,MAAO,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { delay, performance } from \"@fluidframework/common-utils\";\nimport { DriverErrorType } from \"@fluidframework/driver-definitions\";\nimport { canRetryOnError, getRetryDelayFromError } from \"./network\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { NonRetryableError } from \".\";\n\n/**\n * Interface describing an object passed to various network APIs.\n * It allows caller to control cancellation, as well as learn about any delays.\n */\nexport interface IProgress {\n /**\n * Abort signal used to cancel operation.\n *\n * @remarks Note that most of the layers do not use this signal yet. We need to change that over time.\n * Please consult with API documentation / implementation.\n * Note that number of layers may not check this signal while holding this request in a queue,\n * so it may take a while it takes effect. This can be improved in the future.\n *\n * The layers in question are:\n *\n * - driver (RateLimiter)\n *\n * - runWithRetry\n */\n cancel?: AbortSignal;\n\n /**\n * Called whenever api returns cancellable error and the call is going to be retried.\n * Any exception thrown from this call back result in cancellation of operation\n * and propagation of thrown exception.\n * @param delayInMs - delay before next retry. This value will depend on internal back-off logic,\n * as well as information provided by service (like 429 error asking to wait for some time before retry)\n * @param error - error object returned from the call.\n */\n onRetry?(delayInMs: number, error: any): void;\n}\n\nexport async function runWithRetry<T>(\n api: (cancel?: AbortSignal) => Promise<T>,\n fetchCallName: string,\n logger: ITelemetryLogger,\n progress: IProgress,\n): Promise<T> {\n let result: T | undefined;\n let success = false;\n let retryAfterMs = 1000; // has to be positive!\n let numRetries = 0;\n const startTime = performance.now();\n let lastError: any;\n do {\n try {\n result = await api(progress.cancel);\n success = true;\n } catch (err) {\n // If it is not retriable, then just throw the error.\n if (!canRetryOnError(err)) {\n logger.sendTelemetryEvent({\n eventName: `${fetchCallName}_cancel`,\n retry: numRetries,\n duration: performance.now() - startTime,\n fetchCallName,\n }, err);\n throw err;\n }\n\n if (progress.cancel?.aborted === true) {\n logger.sendTelemetryEvent({\n eventName: `${fetchCallName}_runWithRetryAborted`,\n retry: numRetries,\n duration: performance.now() - startTime,\n fetchCallName,\n }, err);\n throw new NonRetryableError(\n \"runWithRetry was Aborted\",\n DriverErrorType.genericError,\n { driverVersion: pkgVersion, fetchCallName },\n );\n }\n\n // logging the first failed retry instead of every attempt. We want to avoid filling telemetry\n // when we have tight loop of retrying in offline mode, but we also want to know what caused\n // the failure in the first place\n if(numRetries === 0) {\n logger.sendTelemetryEvent({\n eventName: `${fetchCallName}_firstFailed`,\n duration: performance.now() - startTime,\n fetchCallName,\n }, err);\n }\n\n numRetries++;\n lastError = err;\n // If the error is throttling error, then wait for the specified time before retrying.\n // If the waitTime is not specified, then we start with retrying immediately to max of 8s.\n retryAfterMs = getRetryDelayFromError(err) ?? Math.min(retryAfterMs * 2, 8000);\n if (progress.onRetry) {\n progress.onRetry(retryAfterMs, err);\n }\n await delay(retryAfterMs);\n }\n } while (!success);\n if (numRetries > 0) {\n logger.sendTelemetryEvent({\n eventName: `${fetchCallName}_lastError`,\n retry: numRetries,\n duration: performance.now() - startTime,\n fetchCallName,\n },\n lastError);\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return result!;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/driver-utils",
|
|
3
|
-
"version": "2.0.0-internal.2.
|
|
3
|
+
"version": "2.0.0-internal.2.4.0",
|
|
4
4
|
"description": "Collection of utility functions for Fluid drivers",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -64,28 +64,28 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
66
66
|
"@fluidframework/common-utils": "^1.0.0",
|
|
67
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.
|
|
68
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.2.
|
|
67
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
68
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
69
69
|
"@fluidframework/gitresources": "^0.1038.2000",
|
|
70
70
|
"@fluidframework/protocol-base": "^0.1038.2000",
|
|
71
71
|
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
72
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-internal.2.
|
|
72
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
73
73
|
"axios": "^0.26.0",
|
|
74
74
|
"url": "^0.11.0",
|
|
75
75
|
"uuid": "^8.3.1"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@fluid-tools/build-cli": "^0.
|
|
78
|
+
"@fluid-tools/build-cli": "^0.8.0",
|
|
79
79
|
"@fluidframework/build-common": "^1.1.0",
|
|
80
|
-
"@fluidframework/build-tools": "^0.
|
|
80
|
+
"@fluidframework/build-tools": "^0.8.0",
|
|
81
81
|
"@fluidframework/driver-utils-previous": "npm:@fluidframework/driver-utils@2.0.0-internal.2.2.0",
|
|
82
82
|
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
83
|
-
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.2.
|
|
84
|
-
"@fluidframework/runtime-utils": ">=2.0.0-internal.2.
|
|
83
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
84
|
+
"@fluidframework/runtime-utils": ">=2.0.0-internal.2.4.0 <2.0.0-internal.3.0.0",
|
|
85
85
|
"@microsoft/api-extractor": "^7.22.2",
|
|
86
86
|
"@rushstack/eslint-config": "^2.5.1",
|
|
87
87
|
"@types/mocha": "^9.1.1",
|
|
88
|
-
"@types/node": "^14.18.
|
|
88
|
+
"@types/node": "^14.18.36",
|
|
89
89
|
"@types/sinon": "^7.0.13",
|
|
90
90
|
"concurrently": "^6.2.0",
|
|
91
91
|
"copyfiles": "^2.4.1",
|
|
@@ -102,6 +102,28 @@
|
|
|
102
102
|
"version": "2.0.0-internal.2.3.0",
|
|
103
103
|
"baselineRange": ">=2.0.0-internal.2.2.0 <2.0.0-internal.2.3.0",
|
|
104
104
|
"baselineVersion": "2.0.0-internal.2.2.0",
|
|
105
|
-
"broken": {
|
|
105
|
+
"broken": {
|
|
106
|
+
"ClassDeclaration_AuthorizationError": {
|
|
107
|
+
"backCompat": false
|
|
108
|
+
},
|
|
109
|
+
"ClassDeclaration_DeltaStreamConnectionForbiddenError": {
|
|
110
|
+
"backCompat": false
|
|
111
|
+
},
|
|
112
|
+
"ClassDeclaration_FluidInvalidSchemaError": {
|
|
113
|
+
"backCompat": false
|
|
114
|
+
},
|
|
115
|
+
"ClassDeclaration_GenericNetworkError": {
|
|
116
|
+
"backCompat": false
|
|
117
|
+
},
|
|
118
|
+
"ClassDeclaration_LocationRedirectionError": {
|
|
119
|
+
"backCompat": false
|
|
120
|
+
},
|
|
121
|
+
"ClassDeclaration_ThrottlingError": {
|
|
122
|
+
"backCompat": false
|
|
123
|
+
},
|
|
124
|
+
"ClassDeclaration_UsageError": {
|
|
125
|
+
"backCompat": false
|
|
126
|
+
}
|
|
127
|
+
}
|
|
106
128
|
}
|
|
107
129
|
}
|
package/src/packageVersion.ts
CHANGED
package/src/runWithRetry.ts
CHANGED
|
@@ -84,6 +84,17 @@ export async function runWithRetry<T>(
|
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
// logging the first failed retry instead of every attempt. We want to avoid filling telemetry
|
|
88
|
+
// when we have tight loop of retrying in offline mode, but we also want to know what caused
|
|
89
|
+
// the failure in the first place
|
|
90
|
+
if(numRetries === 0) {
|
|
91
|
+
logger.sendTelemetryEvent({
|
|
92
|
+
eventName: `${fetchCallName}_firstFailed`,
|
|
93
|
+
duration: performance.now() - startTime,
|
|
94
|
+
fetchCallName,
|
|
95
|
+
}, err);
|
|
96
|
+
}
|
|
97
|
+
|
|
87
98
|
numRetries++;
|
|
88
99
|
lastError = err;
|
|
89
100
|
// If the error is throttling error, then wait for the specified time before retrying.
|