@fluidframework/container-runtime 0.57.0-51086 → 0.57.2
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/containerRuntime.d.ts +10 -6
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +64 -30
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts +1 -36
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +5 -27
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +5 -7
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +11 -6
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +1 -1
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +2 -2
- package/dist/dataStores.js.map +1 -1
- package/dist/garbageCollection.d.ts +24 -11
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +94 -53
- package/dist/garbageCollection.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/containerRuntime.d.ts +10 -6
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +65 -31
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts +1 -36
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +4 -26
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +5 -7
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +11 -6
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +1 -1
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +2 -2
- package/lib/dataStores.js.map +1 -1
- package/lib/garbageCollection.d.ts +24 -11
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +94 -53
- package/lib/garbageCollection.js.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +13 -13
- package/src/containerRuntime.ts +98 -34
- package/src/dataStore.ts +6 -42
- package/src/dataStoreContext.ts +15 -13
- package/src/dataStores.ts +8 -3
- package/src/garbageCollection.ts +114 -57
- package/src/index.ts +0 -1
- package/src/packageVersion.ts +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,oBAAoB,EACpB,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,oBAAoB,EACpB,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACH,YAAY,EACZ,SAAS,EACT,yBAAyB,EACzB,QAAQ,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,aAAa,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACH,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gCAAgC,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.neverCancelledSummaryToken = exports.SummaryCollection = exports.ISummarizer = exports.Summarizer = exports.gcTreeKey = exports.gcBlobPrefix = exports.FluidDataStoreRegistry = exports.DeltaScheduler = exports.
|
|
7
|
+
exports.neverCancelledSummaryToken = exports.SummaryCollection = exports.ISummarizer = exports.Summarizer = exports.gcTreeKey = exports.gcBlobPrefix = exports.FluidDataStoreRegistry = exports.DeltaScheduler = exports.RuntimeHeaders = exports.ContainerRuntime = exports.agentSchedulerId = exports.ScheduleManager = exports.unpackRuntimeMessage = exports.RuntimeMessage = exports.isRuntimeMessage = exports.ContainerMessageType = void 0;
|
|
8
8
|
var containerRuntime_1 = require("./containerRuntime");
|
|
9
9
|
Object.defineProperty(exports, "ContainerMessageType", { enumerable: true, get: function () { return containerRuntime_1.ContainerMessageType; } });
|
|
10
10
|
Object.defineProperty(exports, "isRuntimeMessage", { enumerable: true, get: function () { return containerRuntime_1.isRuntimeMessage; } });
|
|
@@ -14,8 +14,6 @@ Object.defineProperty(exports, "ScheduleManager", { enumerable: true, get: funct
|
|
|
14
14
|
Object.defineProperty(exports, "agentSchedulerId", { enumerable: true, get: function () { return containerRuntime_1.agentSchedulerId; } });
|
|
15
15
|
Object.defineProperty(exports, "ContainerRuntime", { enumerable: true, get: function () { return containerRuntime_1.ContainerRuntime; } });
|
|
16
16
|
Object.defineProperty(exports, "RuntimeHeaders", { enumerable: true, get: function () { return containerRuntime_1.RuntimeHeaders; } });
|
|
17
|
-
var dataStore_1 = require("./dataStore");
|
|
18
|
-
Object.defineProperty(exports, "AliasResult", { enumerable: true, get: function () { return dataStore_1.AliasResult; } });
|
|
19
17
|
var deltaScheduler_1 = require("./deltaScheduler");
|
|
20
18
|
Object.defineProperty(exports, "DeltaScheduler", { enumerable: true, get: function () { return deltaScheduler_1.DeltaScheduler; } });
|
|
21
19
|
var dataStoreRegistry_1 = require("./dataStoreRegistry");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAe4B;AAdxB,wHAAA,oBAAoB,OAAA;AAOpB,oHAAA,gBAAgB,OAAA;AAChB,kHAAA,cAAc,OAAA;AACd,wHAAA,oBAAoB,OAAA;AACpB,mHAAA,eAAe,OAAA;AACf,oHAAA,gBAAgB,OAAA;AAChB,oHAAA,gBAAgB,OAAA;AAChB,kHAAA,cAAc,OAAA;AAElB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAe4B;AAdxB,wHAAA,oBAAoB,OAAA;AAOpB,oHAAA,gBAAgB,OAAA;AAChB,kHAAA,cAAc,OAAA;AACd,wHAAA,oBAAoB,OAAA;AACpB,mHAAA,eAAe,OAAA;AACf,oHAAA,gBAAgB,OAAA;AAChB,oHAAA,gBAAgB,OAAA;AAChB,kHAAA,cAAc,OAAA;AAElB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,yDAA6D;AAApD,2HAAA,sBAAsB,OAAA;AAC/B,yDAK6B;AAJzB,iHAAA,YAAY,OAAA;AACZ,8GAAA,SAAS,OAAA;AAWb,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDA4B2B;AAXvB,8GAAA,WAAW,OAAA;AAYf,yDAW6B;AADzB,sHAAA,iBAAiB,OAAA;AAErB,+EAA8G;AAAnE,0IAAA,0BAA0B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n ContainerMessageType,\n IChunkedOp,\n ContainerRuntimeMessage,\n IGCRuntimeOptions,\n ISummaryRuntimeOptions,\n IContainerRuntimeOptions,\n IRootSummaryTreeWithStats,\n isRuntimeMessage,\n RuntimeMessage,\n unpackRuntimeMessage,\n ScheduleManager,\n agentSchedulerId,\n ContainerRuntime,\n RuntimeHeaders,\n} from \"./containerRuntime\";\nexport { DeltaScheduler } from \"./deltaScheduler\";\nexport { FluidDataStoreRegistry } from \"./dataStoreRegistry\";\nexport {\n gcBlobPrefix,\n gcTreeKey,\n IGarbageCollectionRuntime,\n IGCStats,\n} from \"./garbageCollection\";\nexport {\n IPendingFlush,\n IPendingFlushMode,\n IPendingLocalState,\n IPendingMessage,\n IPendingState,\n} from \"./pendingStateManager\";\nexport { Summarizer } from \"./summarizer\";\nexport {\n EnqueueSummarizeResult,\n IAckSummaryResult,\n IBaseSummarizeResult,\n IBroadcastSummaryResult,\n ICancellationToken,\n IConnectableRuntime,\n IEnqueueSummarizeOptions,\n IGenerateSummaryTreeResult,\n IGeneratedSummaryStats,\n INackSummaryResult,\n IOnDemandSummarizeOptions,\n IProvideSummarizer,\n ISubmitSummaryOpResult,\n ISubmitSummaryOptions,\n ISummarizeOptions,\n ISummarizeResults,\n ISummarizer,\n ISummarizerEvents,\n ISummarizerInternalsProvider,\n ISummarizerOptions,\n ISummarizerRuntime,\n ISummarizingWarning,\n ISummaryCancellationToken,\n IUploadSummaryResult,\n SubmitSummaryResult,\n SummarizeResultPart,\n SummarizerStopReason,\n} from \"./summarizerTypes\";\nexport {\n IAckedSummary,\n IClientSummaryWatcher,\n ISummary,\n ISummaryCollectionOpEvents,\n ISummaryAckMessage,\n ISummaryNackMessage,\n ISummaryOpMessage,\n OpActionEventListener,\n OpActionEventName,\n SummaryCollection,\n} from \"./summaryCollection\";\nexport { ICancellableSummarizerController, neverCancelledSummaryToken } from \"./runWhileConnectedCoordinator\";\n"]}
|
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/container-runtime";
|
|
8
|
-
export declare const pkgVersion = "0.57.
|
|
8
|
+
export declare const pkgVersion = "0.57.2";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,sCAAsC,CAAC;AAC3D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,sCAAsC,CAAC;AAC3D,eAAO,MAAM,UAAU,WAAW,CAAC"}
|
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/container-runtime";
|
|
11
|
-
exports.pkgVersion = "0.57.
|
|
11
|
+
exports.pkgVersion = "0.57.2";
|
|
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,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,UAAU,GAAG,QAAQ,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/container-runtime\";\nexport const pkgVersion = \"0.57.2\";\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
/*!
|
|
2
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
4
|
* Licensed under the MIT License.
|
|
4
5
|
*/
|
|
5
|
-
/// <reference types="node" />
|
|
6
6
|
import { EventEmitter } from "events";
|
|
7
7
|
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
8
8
|
import { FluidObject, IFluidHandle, IFluidHandleContext, IFluidObject, IFluidRouter, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
@@ -11,11 +11,10 @@ import { IContainerRuntime, IContainerRuntimeEvents } from "@fluidframework/cont
|
|
|
11
11
|
import { TypedEventEmitter } from "@fluidframework/common-utils";
|
|
12
12
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
13
13
|
import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMessage, ISignalMessage, ISummaryConfiguration, ISummaryTree, MessageType } from "@fluidframework/protocol-definitions";
|
|
14
|
-
import { FlushMode, IFluidDataStoreContextDetached, IFluidDataStoreRegistry, IGarbageCollectionData, NamedFluidDataStoreRegistryEntries, ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
|
|
14
|
+
import { FlushMode, IFluidDataStoreContextDetached, IFluidDataStoreRegistry, IGarbageCollectionData, NamedFluidDataStoreRegistryEntries, ISummaryTreeWithStats, IDataStore } from "@fluidframework/runtime-definitions";
|
|
15
15
|
import { IPendingLocalState } from "./pendingStateManager";
|
|
16
16
|
import { SubmitSummaryResult, ISubmitSummaryOptions, ISummarizer, ISummarizerInternalsProvider, ISummarizerOptions, ISummarizerRuntime } from "./summarizerTypes";
|
|
17
17
|
import { IGarbageCollectionRuntime, IGCStats } from "./garbageCollection";
|
|
18
|
-
import { IDataStore } from "./dataStore";
|
|
19
18
|
export declare enum ContainerMessageType {
|
|
20
19
|
FluidDataStoreOp = "component",
|
|
21
20
|
Attach = "attach",
|
|
@@ -215,12 +214,15 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
215
214
|
private readonly summaryCollection;
|
|
216
215
|
private readonly summarizerNode;
|
|
217
216
|
private readonly _aliasingEnabled;
|
|
217
|
+
private readonly maxConsecutiveReconnects;
|
|
218
|
+
private readonly defaultMaxConsecutiveReconnects;
|
|
218
219
|
private _orderSequentiallyCalls;
|
|
219
220
|
private _flushMode;
|
|
220
221
|
private needsFlush;
|
|
221
222
|
private flushTrigger;
|
|
222
223
|
private _connected;
|
|
223
224
|
private paused;
|
|
225
|
+
private consecutiveReconnects;
|
|
224
226
|
get connected(): boolean;
|
|
225
227
|
/** clientId of parent (non-summarizing) container that owns summarizer container */
|
|
226
228
|
get summarizerClientId(): string | undefined;
|
|
@@ -249,8 +251,8 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
249
251
|
* and is the single source of truth for this container.
|
|
250
252
|
*/
|
|
251
253
|
readonly disableIsolatedChannels: boolean;
|
|
252
|
-
/** The message
|
|
253
|
-
private
|
|
254
|
+
/** The last message processed at the time of the last summary. */
|
|
255
|
+
private messageAtLastSummary;
|
|
254
256
|
private get summarizer();
|
|
255
257
|
private get summariesDisabled();
|
|
256
258
|
private readonly createContainerMetadata;
|
|
@@ -271,6 +273,8 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
271
273
|
private getDataStoreFromRequest;
|
|
272
274
|
private formMetadata;
|
|
273
275
|
private addContainerStateToSummary;
|
|
276
|
+
private shouldContinueReconnecting;
|
|
277
|
+
private resetReconnectCount;
|
|
274
278
|
private replayPendingStates;
|
|
275
279
|
/**
|
|
276
280
|
* Used to apply stashed ops at their reference sequence number.
|
|
@@ -321,7 +325,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
321
325
|
* This method will be removed. See #6465.
|
|
322
326
|
*/
|
|
323
327
|
private _createDataStoreWithPropsLegacy;
|
|
324
|
-
_createDataStoreWithProps(pkg: string | string[], props?: any, id?: string, isRoot?: boolean): Promise<
|
|
328
|
+
_createDataStoreWithProps(pkg: string | string[], props?: any, id?: string, isRoot?: boolean): Promise<IDataStore>;
|
|
325
329
|
private _createDataStore;
|
|
326
330
|
private canSendOps;
|
|
327
331
|
getQuorum(): IQuorumClients;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerRuntime.d.ts","sourceRoot":"","sources":["../src/containerRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"containerRuntime.d.ts","sourceRoot":"","sources":["../src/containerRuntime.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAgD,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACpH,OAAO,EACH,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EAEb,QAAQ,EAER,uBAAuB,EACvB,WAAW,EACX,cAAc,EAEjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,iBAAiB,EACjB,uBAAuB,EAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAGH,iBAAiB,EAGpB,MAAM,8BAA8B,CAAC;AAWtC,OAAO,EAAgB,uBAAuB,EAAmB,MAAM,oCAAoC,CAAC;AAQ5G,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EAErB,YAAY,EACZ,WAAW,EAEd,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,SAAS,EAET,8BAA8B,EAC9B,uBAAuB,EAEvB,sBAAsB,EAKtB,kCAAkC,EAClC,qBAAqB,EAMrB,UAAU,EACb,MAAM,qCAAqC,CAAC;AAqB7C,OAAO,EAAE,kBAAkB,EAAuB,MAAM,uBAAuB,CAAC;AAmBhF,OAAO,EACH,mBAAmB,EAGnB,qBAAqB,EACrB,WAAW,EACX,4BAA4B,EAC5B,kBAAkB,EAClB,kBAAkB,EACr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O,CAAC,uBAAuB;CAyBlC"}
|
package/lib/containerRuntime.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
1
|
import { AttachState, LoaderHeader, } from "@fluidframework/container-definitions";
|
|
6
2
|
import { assert, Trace, TypedEventEmitter, unreachableCase, performance, } from "@fluidframework/common-utils";
|
|
7
3
|
import { ChildLogger, raiseConnectedEvent, PerformanceEvent, normalizeError, TaggedLoggerAdapter, loggerToMonitoringContext, TelemetryDataTag, } from "@fluidframework/telemetry-utils";
|
|
@@ -29,7 +25,7 @@ import { SummarizerClientElection, summarizerClientType } from "./summarizerClie
|
|
|
29
25
|
import { formExponentialFn, Throttler } from "./throttler";
|
|
30
26
|
import { RunWhileConnectedCoordinator } from "./runWhileConnectedCoordinator";
|
|
31
27
|
import { GarbageCollector, gcTreeKey, } from "./garbageCollection";
|
|
32
|
-
import {
|
|
28
|
+
import { channelToDataStore, isDataStoreAliasMessage, } from "./dataStore";
|
|
33
29
|
export var ContainerMessageType;
|
|
34
30
|
(function (ContainerMessageType) {
|
|
35
31
|
// An op to be delivered to store
|
|
@@ -75,6 +71,7 @@ export var RuntimeHeaders;
|
|
|
75
71
|
// Local storage key to set the default flush mode to TurnBased
|
|
76
72
|
const turnBasedFlushModeKey = "Fluid.ContainerRuntime.FlushModeTurnBased";
|
|
77
73
|
const useDataStoreAliasingKey = "Fluid.ContainerRuntime.UseDataStoreAliasing";
|
|
74
|
+
const maxConsecutiveReconnectsKey = "Fluid.ContainerRuntime.MaxConsecutiveReconnects";
|
|
78
75
|
export var RuntimeMessage;
|
|
79
76
|
(function (RuntimeMessage) {
|
|
80
77
|
RuntimeMessage["FluidDataStoreOp"] = "component";
|
|
@@ -348,7 +345,7 @@ export function getDeviceSpec() {
|
|
|
348
345
|
*/
|
|
349
346
|
export class ContainerRuntime extends TypedEventEmitter {
|
|
350
347
|
constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, requestHandler, _storage) {
|
|
351
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
348
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
352
349
|
super();
|
|
353
350
|
this.context = context;
|
|
354
351
|
this.registry = registry;
|
|
@@ -357,10 +354,12 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
357
354
|
this.logger = logger;
|
|
358
355
|
this.requestHandler = requestHandler;
|
|
359
356
|
this._storage = _storage;
|
|
357
|
+
this.defaultMaxConsecutiveReconnects = 15;
|
|
360
358
|
this._orderSequentiallyCalls = 0;
|
|
361
359
|
this.needsFlush = false;
|
|
362
360
|
this.flushTrigger = false;
|
|
363
361
|
this.paused = false;
|
|
362
|
+
this.consecutiveReconnects = 0;
|
|
364
363
|
this._disposed = false;
|
|
365
364
|
this.emitDirtyDocumentEvent = true;
|
|
366
365
|
this.summarizerWarning = (warning) => this.mc.logger.sendTelemetryEvent({ eventName: "summarizerWarning" }, warning);
|
|
@@ -413,7 +412,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
413
412
|
throw new UsageError(`Can't summarize, disableSummaries: ${this.summariesDisabled}`);
|
|
414
413
|
}
|
|
415
414
|
};
|
|
416
|
-
this.
|
|
415
|
+
this.messageAtLastSummary = metadata === null || metadata === void 0 ? void 0 : metadata.message;
|
|
417
416
|
// If this is an existing container, we get values from metadata.
|
|
418
417
|
// otherwise, we initialize them.
|
|
419
418
|
if (existing) {
|
|
@@ -440,20 +439,13 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
440
439
|
this._aliasingEnabled =
|
|
441
440
|
((_c = this.mc.config.getBoolean(useDataStoreAliasingKey)) !== null && _c !== void 0 ? _c : false) ||
|
|
442
441
|
((_d = runtimeOptions.useDataStoreAliasing) !== null && _d !== void 0 ? _d : false);
|
|
442
|
+
this.maxConsecutiveReconnects = (_e = this.mc.config.getNumber(maxConsecutiveReconnectsKey)) !== null && _e !== void 0 ? _e : this.defaultMaxConsecutiveReconnects;
|
|
443
|
+
this.garbageCollector = GarbageCollector.create(this, this.runtimeOptions.gcOptions, (unusedRoutes) => this.dataStores.deleteUnusedRoutes(unusedRoutes), (nodePath) => this.dataStores.getNodePackagePath(nodePath),
|
|
443
444
|
/**
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
* We use the timestamp of the last op for current timestamp. However, there can be cases where
|
|
447
|
-
* we don't have an op (on demand summaries for instance). In those cases, we will use the timestamp
|
|
448
|
-
* of this client's connection.
|
|
445
|
+
* Returns the timestamp of the last message seen by this client. This is used by garbage collector as
|
|
446
|
+
* the current reference timestamp for tracking unreferenced objects.
|
|
449
447
|
*/
|
|
450
|
-
|
|
451
|
-
var _a, _b, _c;
|
|
452
|
-
const client = this.clientId !== undefined ? this.getAudience().getMember(this.clientId) : undefined;
|
|
453
|
-
const timestamp = client === null || client === void 0 ? void 0 : client.timestamp;
|
|
454
|
-
return (_c = (_b = (_a = this.deltaManager.lastMessage) === null || _a === void 0 ? void 0 : _a.timestamp) !== null && _b !== void 0 ? _b : timestamp) !== null && _c !== void 0 ? _c : Date.now();
|
|
455
|
-
};
|
|
456
|
-
this.garbageCollector = GarbageCollector.create(this, this.runtimeOptions.gcOptions, (unusedRoutes) => this.dataStores.deleteUnusedRoutes(unusedRoutes), (nodePath) => this.dataStores.getNodePackagePath(nodePath), getCurrentTimestamp, this.closeFn, context.baseSnapshot, async (id) => readAndParse(this.storage, id), this.mc.logger, existing, metadata);
|
|
448
|
+
() => { var _a, _b, _c; return (_b = (_a = this.deltaManager.lastMessage) === null || _a === void 0 ? void 0 : _a.timestamp) !== null && _b !== void 0 ? _b : (_c = this.messageAtLastSummary) === null || _c === void 0 ? void 0 : _c.timestamp; }, () => { var _a; return (_a = this.messageAtLastSummary) === null || _a === void 0 ? void 0 : _a.timestamp; }, context.baseSnapshot, async (id) => readAndParse(this.storage, id), this.mc.logger, existing, metadata);
|
|
457
449
|
const loadedFromSequenceNumber = this.deltaManager.initialSequenceNumber;
|
|
458
450
|
this.summarizerNode = createRootSummarizerNodeWithGC(ChildLogger.create(this.logger, "SummarizerNode"),
|
|
459
451
|
// Summarize function to call when summarize is called. Summarizer node always tracks summary state.
|
|
@@ -474,7 +466,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
474
466
|
if (this.context.baseSnapshot) {
|
|
475
467
|
this.summarizerNode.loadBaseSummaryWithoutDifferential(this.context.baseSnapshot);
|
|
476
468
|
}
|
|
477
|
-
this.dataStores = new DataStores(getSummaryForDatastores(context.baseSnapshot, metadata), this, (attachMsg) => this.submit(ContainerMessageType.Attach, attachMsg), (id, createParam) => (summarizeInternal, getGCDataFn, getBaseGCDetailsFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam, undefined, getGCDataFn, getBaseGCDetailsFn), (id) => this.summarizerNode.deleteChild(id), this.mc.logger, async () => this.garbageCollector.getDataStoreBaseGCDetails(), (
|
|
469
|
+
this.dataStores = new DataStores(getSummaryForDatastores(context.baseSnapshot, metadata), this, (attachMsg) => this.submit(ContainerMessageType.Attach, attachMsg), (id, createParam) => (summarizeInternal, getGCDataFn, getBaseGCDetailsFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam, undefined, getGCDataFn, getBaseGCDetailsFn), (id) => this.summarizerNode.deleteChild(id), this.mc.logger, async () => this.garbageCollector.getDataStoreBaseGCDetails(), (path, timestampMs, packagePath) => this.garbageCollector.nodeUpdated(path, "Changed", timestampMs, packagePath), new Map(dataStoreAliasMap), this.garbageCollector.writeDataAtRoot);
|
|
478
470
|
this.blobManager = new BlobManager(this.handleContext, blobManagerSnapshot, () => this.storage, (blobId) => this.submit(ContainerMessageType.BlobAttach, undefined, undefined, { blobId }), this, this.logger);
|
|
479
471
|
this.scheduleManager = new ScheduleManager(context.deltaManager, this, ChildLogger.create(this.logger, "ScheduleManager"));
|
|
480
472
|
this.deltaSender = this.deltaManager;
|
|
@@ -485,7 +477,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
485
477
|
this.summaryCollection = new SummaryCollection(this.deltaManager, this.logger);
|
|
486
478
|
const { attachState, pendingLocalState } = this.context;
|
|
487
479
|
this.dirtyContainer = attachState !== AttachState.Attached
|
|
488
|
-
|| ((
|
|
480
|
+
|| ((_f = pendingLocalState) === null || _f === void 0 ? void 0 : _f.pendingStates.length) > 0;
|
|
489
481
|
this.context.updateDirtyContainerState(this.dirtyContainer);
|
|
490
482
|
// Map the deprecated generateSummaries flag to disableSummaries.
|
|
491
483
|
if (this.runtimeOptions.summaryOptions.generateSummaries === false) {
|
|
@@ -498,8 +490,8 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
498
490
|
const orderedClientLogger = ChildLogger.create(this.logger, "OrderedClientElection");
|
|
499
491
|
const orderedClientCollection = new OrderedClientCollection(orderedClientLogger, this.context.deltaManager, this.context.quorum);
|
|
500
492
|
const orderedClientElectionForSummarizer = new OrderedClientElection(orderedClientLogger, orderedClientCollection, electedSummarizerData !== null && electedSummarizerData !== void 0 ? electedSummarizerData : this.context.deltaManager.lastSequenceNumber, SummarizerClientElection.isClientEligible);
|
|
501
|
-
const summarizerClientElectionEnabled = (
|
|
502
|
-
const maxOpsSinceLastSummary = (
|
|
493
|
+
const summarizerClientElectionEnabled = (_g = this.mc.config.getBoolean("Fluid.ContainerRuntime.summarizerClientElection")) !== null && _g !== void 0 ? _g : ((_h = this.runtimeOptions.summaryOptions) === null || _h === void 0 ? void 0 : _h.summarizerClientElection) === true;
|
|
494
|
+
const maxOpsSinceLastSummary = (_j = this.runtimeOptions.summaryOptions.maxOpsSinceLastSummary) !== null && _j !== void 0 ? _j : 7000;
|
|
503
495
|
this.summarizerClientElection = new SummarizerClientElection(orderedClientLogger, this.summaryCollection, orderedClientElectionForSummarizer, maxOpsSinceLastSummary, summarizerClientElectionEnabled);
|
|
504
496
|
if (this.context.clientDetails.type === summarizerClientType) {
|
|
505
497
|
this._summarizer = new Summarizer("/_summarizer", this /* ISummarizerRuntime */, () => this.summaryConfiguration, this /* ISummarizerInternalsProvider */, this.handleContext, this.summaryCollection, async (runtime) => RunWhileConnectedCoordinator.create(runtime));
|
|
@@ -846,17 +838,15 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
846
838
|
}
|
|
847
839
|
}
|
|
848
840
|
const dataStoreChannel = await dataStoreContext.realize();
|
|
849
|
-
|
|
850
|
-
// that the package path is available.
|
|
851
|
-
this.garbageCollector.nodeUpdated(`/${id}`, "Loaded", dataStoreContext.packagePath, request === null || request === void 0 ? void 0 : request.headers);
|
|
841
|
+
this.garbageCollector.nodeUpdated(`/${id}`, "Loaded", undefined /* timestampMs */, dataStoreContext.packagePath, request === null || request === void 0 ? void 0 : request.headers);
|
|
852
842
|
return dataStoreChannel;
|
|
853
843
|
}
|
|
854
844
|
formMetadata() {
|
|
855
845
|
var _a;
|
|
856
846
|
return Object.assign(Object.assign({}, this.createContainerMetadata), { summaryCount: this.summaryCount, summaryFormatVersion: 1, disableIsolatedChannels: this.disableIsolatedChannels || undefined, gcFeature: this.garbageCollector.gcSummaryFeatureVersion,
|
|
857
|
-
// The last message processed at the time of summary. If there are no messages,
|
|
858
|
-
//
|
|
859
|
-
message: (_a = extractSummaryMetadataMessage(this.deltaManager.lastMessage)) !== null && _a !== void 0 ? _a : this.
|
|
847
|
+
// The last message processed at the time of summary. If there are no new messages, use the message from the
|
|
848
|
+
// last summary.
|
|
849
|
+
message: (_a = extractSummaryMetadataMessage(this.deltaManager.lastMessage)) !== null && _a !== void 0 ? _a : this.messageAtLastSummary, sessionExpiryTimeoutMs: this.garbageCollector.sessionExpiryTimeoutMs });
|
|
860
850
|
}
|
|
861
851
|
addContainerStateToSummary(summaryTree) {
|
|
862
852
|
var _a;
|
|
@@ -887,6 +877,37 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
887
877
|
}
|
|
888
878
|
}
|
|
889
879
|
}
|
|
880
|
+
// Track how many times the container tries to reconnect with pending messages.
|
|
881
|
+
// This happens when the connection state is changed and we reset the counter
|
|
882
|
+
// when we are able to process a local op or when there are no pending messages.
|
|
883
|
+
// If this counter reaches a max, it's a good indicator that the container
|
|
884
|
+
// is not making progress and it is stuck in a retry loop.
|
|
885
|
+
shouldContinueReconnecting() {
|
|
886
|
+
if (this.maxConsecutiveReconnects <= 0) {
|
|
887
|
+
// Feature disabled, we never stop reconnecting
|
|
888
|
+
return true;
|
|
889
|
+
}
|
|
890
|
+
if (!this.pendingStateManager.hasPendingMessages()) {
|
|
891
|
+
// If there are no pending messages, we can always reconnect
|
|
892
|
+
this.resetReconnectCount();
|
|
893
|
+
return true;
|
|
894
|
+
}
|
|
895
|
+
this.consecutiveReconnects++;
|
|
896
|
+
if (this.consecutiveReconnects === Math.floor(this.maxConsecutiveReconnects / 2)) {
|
|
897
|
+
// If we're halfway through the max reconnects, send an event in order
|
|
898
|
+
// to better identify false positives, if any. If the rate of this event
|
|
899
|
+
// matches `MaxReconnectsWithNoProgress`, we can safely cut down
|
|
900
|
+
// maxConsecutiveReconnects to half.
|
|
901
|
+
this.mc.logger.sendTelemetryEvent({
|
|
902
|
+
eventName: "ReconnectsWithNoProgress",
|
|
903
|
+
attempts: this.consecutiveReconnects,
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
return this.consecutiveReconnects < this.maxConsecutiveReconnects;
|
|
907
|
+
}
|
|
908
|
+
resetReconnectCount() {
|
|
909
|
+
this.consecutiveReconnects = 0;
|
|
910
|
+
}
|
|
890
911
|
replayPendingStates() {
|
|
891
912
|
// We need to be able to send ops to replay states
|
|
892
913
|
if (!this.canSendOps()) {
|
|
@@ -939,6 +960,11 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
939
960
|
if (changeOfState) {
|
|
940
961
|
this.deltaManager.off("op", this.onOp);
|
|
941
962
|
this.context.pendingLocalState = undefined;
|
|
963
|
+
if (!this.shouldContinueReconnecting()) {
|
|
964
|
+
this.closeFn(new GenericError("MaxReconnectsWithNoProgress", undefined, // error
|
|
965
|
+
{ attempts: this.consecutiveReconnects }));
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
942
968
|
this.replayPendingStates();
|
|
943
969
|
}
|
|
944
970
|
this.dataStores.setConnectionState(connected, clientId);
|
|
@@ -991,6 +1017,12 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
991
1017
|
}
|
|
992
1018
|
this.emit("op", message);
|
|
993
1019
|
this.scheduleManager.afterOpProcessing(undefined, message);
|
|
1020
|
+
if (local) {
|
|
1021
|
+
// If we have processed a local op, this means that the container is
|
|
1022
|
+
// making progress and we can reset the counter for how many times
|
|
1023
|
+
// we have consecutively replayed the pending states
|
|
1024
|
+
this.resetReconnectCount();
|
|
1025
|
+
}
|
|
994
1026
|
}
|
|
995
1027
|
catch (e) {
|
|
996
1028
|
this.scheduleManager.afterOpProcessing(e, message);
|
|
@@ -1118,7 +1150,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1118
1150
|
const dataStore = await this._createDataStore(pkg, false /* isRoot */, internalId, props);
|
|
1119
1151
|
const aliasedDataStore = channelToDataStore(dataStore, internalId, this, this.dataStores, this.mc.logger);
|
|
1120
1152
|
const result = await aliasedDataStore.trySetAlias(alias);
|
|
1121
|
-
if (result !==
|
|
1153
|
+
if (result !== "Success") {
|
|
1122
1154
|
throw new GenericError("dataStoreAliasFailure", undefined /* error */, {
|
|
1123
1155
|
alias: {
|
|
1124
1156
|
value: alias,
|
|
@@ -1150,7 +1182,7 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1150
1182
|
if (isRoot) {
|
|
1151
1183
|
fluidDataStore.bindToContext();
|
|
1152
1184
|
}
|
|
1153
|
-
return fluidDataStore;
|
|
1185
|
+
return channelToDataStore(fluidDataStore, id, this, this.dataStores, this.mc.logger);
|
|
1154
1186
|
}
|
|
1155
1187
|
async _createDataStoreWithProps(pkg, props, id = uuid(), isRoot = false) {
|
|
1156
1188
|
return this._aliasingEnabled === true && isRoot ?
|
|
@@ -1406,6 +1438,8 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1406
1438
|
return { stage: "base", referenceSequenceNumber: summaryRefSeqNum, error };
|
|
1407
1439
|
}
|
|
1408
1440
|
const { summary: summaryTree, stats: partialStats } = summarizeResult;
|
|
1441
|
+
// Now that we have generated the summary, update the message at last summary to the last message processed.
|
|
1442
|
+
this.messageAtLastSummary = this.deltaManager.lastMessage;
|
|
1409
1443
|
// Counting dataStores and handles
|
|
1410
1444
|
// Because handles are unchanged dataStores in the current logic,
|
|
1411
1445
|
// summarized dataStore count is total dataStore count minus handle count
|