@fluidframework/container-runtime 0.57.0 → 0.58.0-55983
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/batchTracker.d.ts +26 -0
- package/dist/batchTracker.d.ts.map +1 -0
- package/dist/batchTracker.js +59 -0
- package/dist/batchTracker.js.map +1 -0
- package/dist/containerRuntime.d.ts +10 -5
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +113 -35
- 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 +1 -7
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +11 -7
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.js +1 -1
- package/dist/dataStores.js.map +1 -1
- package/dist/garbageCollection.d.ts +1 -0
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +6 -4
- 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/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +1 -6
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/runningSummarizer.d.ts +1 -1
- package/dist/runningSummarizer.d.ts.map +1 -1
- package/dist/runningSummarizer.js +1 -1
- package/dist/runningSummarizer.js.map +1 -1
- package/dist/summarizer.d.ts +3 -4
- package/dist/summarizer.d.ts.map +1 -1
- package/dist/summarizer.js +8 -9
- package/dist/summarizer.js.map +1 -1
- package/dist/summaryGenerator.d.ts +1 -1
- package/dist/summaryGenerator.d.ts.map +1 -1
- package/dist/summaryGenerator.js +1 -1
- package/dist/summaryGenerator.js.map +1 -1
- package/dist/summaryManager.d.ts +2 -6
- package/dist/summaryManager.d.ts.map +1 -1
- package/dist/summaryManager.js +4 -10
- package/dist/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +26 -0
- package/lib/batchTracker.d.ts.map +1 -0
- package/lib/batchTracker.js +54 -0
- package/lib/batchTracker.js.map +1 -0
- package/lib/containerRuntime.d.ts +10 -5
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +114 -36
- 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 +1 -7
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +12 -8
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.js +1 -1
- package/lib/dataStores.js.map +1 -1
- package/lib/garbageCollection.d.ts +1 -0
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +4 -2
- 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/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +1 -6
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/runningSummarizer.d.ts +1 -1
- package/lib/runningSummarizer.d.ts.map +1 -1
- package/lib/runningSummarizer.js +1 -1
- package/lib/runningSummarizer.js.map +1 -1
- package/lib/summarizer.d.ts +3 -4
- package/lib/summarizer.d.ts.map +1 -1
- package/lib/summarizer.js +8 -9
- package/lib/summarizer.js.map +1 -1
- package/lib/summaryGenerator.d.ts +1 -1
- package/lib/summaryGenerator.d.ts.map +1 -1
- package/lib/summaryGenerator.js +1 -1
- package/lib/summaryGenerator.js.map +1 -1
- package/lib/summaryManager.d.ts +2 -6
- package/lib/summaryManager.d.ts.map +1 -1
- package/lib/summaryManager.js +5 -11
- package/lib/summaryManager.js.map +1 -1
- package/package.json +16 -16
- package/src/batchTracker.ts +80 -0
- package/src/containerRuntime.ts +151 -38
- package/src/dataStore.ts +6 -42
- package/src/dataStoreContext.ts +12 -15
- package/src/dataStores.ts +1 -1
- package/src/garbageCollection.ts +11 -10
- package/src/index.ts +0 -1
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +4 -8
- package/src/runningSummarizer.ts +3 -3
- package/src/summarizer.ts +8 -8
- package/src/summaryGenerator.ts +2 -2
- package/src/summaryManager.ts +5 -20
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/// <reference types="node" />
|
|
6
|
+
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
7
|
+
import EventEmitter from "events";
|
|
8
|
+
export declare class BatchTracker {
|
|
9
|
+
private readonly batchEventEmitter;
|
|
10
|
+
private readonly logger;
|
|
11
|
+
private startBatchSequenceNumber;
|
|
12
|
+
private trackedBatchCount;
|
|
13
|
+
private batchProcessingStartTimeStamp;
|
|
14
|
+
constructor(batchEventEmitter: EventEmitter, logger: ITelemetryLogger, batchLengthThreshold: number, batchCountSamplingRate: number, dateTimeProvider?: () => number);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Track batch sizes in terms of op counts and processing times
|
|
18
|
+
*
|
|
19
|
+
* @param batchEventEmitter - event emitter which tracks the lifecycle of batch operations
|
|
20
|
+
* @param logger - logger
|
|
21
|
+
* @param batchLengthThreshold - threshold for the length of a batch when to send an error event
|
|
22
|
+
* @param batchCountSamplingRate - rate for batches for which to send an event with its characteristics
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare const BindBatchTracker: (batchEventEmitter: EventEmitter, logger: ITelemetryLogger, batchLengthThreshold?: number, batchCountSamplingRate?: number) => BatchTracker;
|
|
26
|
+
//# sourceMappingURL=batchTracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batchTracker.d.ts","sourceRoot":"","sources":["../src/batchTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAItE,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,qBAAa,YAAY;IAOjB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IANtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,wBAAwB,CAAqB;IACrD,OAAO,CAAC,iBAAiB,CAAa;IACtC,OAAO,CAAC,6BAA6B,CAAqB;gBAGrC,iBAAiB,EAAE,YAAY,EAChD,MAAM,EAAE,gBAAgB,EACxB,oBAAoB,EAAE,MAAM,EAC5B,sBAAsB,EAAE,MAAM,EAC9B,gBAAgB,GAAE,MAAM,MAAgC;CAyC/D;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,sBACN,YAAY,UACvB,gBAAgB,yBACF,MAAM,2BACJ,MAAM,iBAC4D,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.BindBatchTracker = exports.BatchTracker = void 0;
|
|
8
|
+
const common_utils_1 = require("@fluidframework/common-utils");
|
|
9
|
+
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
10
|
+
class BatchTracker {
|
|
11
|
+
constructor(batchEventEmitter, logger, batchLengthThreshold, batchCountSamplingRate, dateTimeProvider = () => common_utils_1.performance.now()) {
|
|
12
|
+
this.batchEventEmitter = batchEventEmitter;
|
|
13
|
+
this.trackedBatchCount = 0;
|
|
14
|
+
this.logger = telemetry_utils_1.ChildLogger.create(logger, "Batching");
|
|
15
|
+
this.batchEventEmitter.on("batchBegin", (message) => {
|
|
16
|
+
this.startBatchSequenceNumber = message.sequenceNumber;
|
|
17
|
+
this.batchProcessingStartTimeStamp = dateTimeProvider();
|
|
18
|
+
this.trackedBatchCount++;
|
|
19
|
+
});
|
|
20
|
+
this.batchEventEmitter.on("batchEnd", (error, message) => {
|
|
21
|
+
common_utils_1.assert(this.startBatchSequenceNumber !== undefined && this.batchProcessingStartTimeStamp !== undefined, 0x2ba /* "batchBegin must fire before batchEnd" */);
|
|
22
|
+
const length = message.sequenceNumber - this.startBatchSequenceNumber + 1;
|
|
23
|
+
if (length >= batchLengthThreshold) {
|
|
24
|
+
this.logger.sendErrorEvent({
|
|
25
|
+
eventName: "LengthTooBig",
|
|
26
|
+
length,
|
|
27
|
+
threshold: batchLengthThreshold,
|
|
28
|
+
batchEndSequenceNumber: message.sequenceNumber,
|
|
29
|
+
duration: dateTimeProvider() - this.batchProcessingStartTimeStamp,
|
|
30
|
+
batchError: error !== undefined,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (this.trackedBatchCount % batchCountSamplingRate === 0) {
|
|
34
|
+
this.logger.sendPerformanceEvent({
|
|
35
|
+
eventName: "Length",
|
|
36
|
+
length,
|
|
37
|
+
samplingRate: batchCountSamplingRate,
|
|
38
|
+
batchEndSequenceNumber: message.sequenceNumber,
|
|
39
|
+
duration: dateTimeProvider() - this.batchProcessingStartTimeStamp,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
this.startBatchSequenceNumber = undefined;
|
|
43
|
+
this.batchProcessingStartTimeStamp = undefined;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.BatchTracker = BatchTracker;
|
|
48
|
+
/**
|
|
49
|
+
* Track batch sizes in terms of op counts and processing times
|
|
50
|
+
*
|
|
51
|
+
* @param batchEventEmitter - event emitter which tracks the lifecycle of batch operations
|
|
52
|
+
* @param logger - logger
|
|
53
|
+
* @param batchLengthThreshold - threshold for the length of a batch when to send an error event
|
|
54
|
+
* @param batchCountSamplingRate - rate for batches for which to send an event with its characteristics
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
const BindBatchTracker = (batchEventEmitter, logger, batchLengthThreshold = 128, batchCountSamplingRate = 1000) => new BatchTracker(batchEventEmitter, logger, batchLengthThreshold, batchCountSamplingRate);
|
|
58
|
+
exports.BindBatchTracker = BindBatchTracker;
|
|
59
|
+
//# sourceMappingURL=batchTracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batchTracker.js","sourceRoot":"","sources":["../src/batchTracker.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAmE;AAEnE,qEAA8D;AAG9D,MAAa,YAAY;IAMrB,YACqB,iBAA+B,EAChD,MAAwB,EACxB,oBAA4B,EAC5B,sBAA8B,EAC9B,mBAAiC,GAAG,EAAE,CAAC,0BAAW,CAAC,GAAG,EAAE;QAJvC,sBAAiB,GAAjB,iBAAiB,CAAc;QAJ5C,sBAAiB,GAAW,CAAC,CAAC;QAUlC,IAAI,CAAC,MAAM,GAAG,6BAAW,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAErD,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,OAAkC,EAAE,EAAE;YAC3E,IAAI,CAAC,wBAAwB,GAAG,OAAO,CAAC,cAAc,CAAC;YACvD,IAAI,CAAC,6BAA6B,GAAG,gBAAgB,EAAE,CAAC;YACxD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC7B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AY,CAAC,iBAAiB,EAAE,MAAM,EAAE,oBAAoB,EAAE,sBAAsB,CAAC,CAAA;AALjF,QAAA,gBAAgB,oBAKiE","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 { assert, performance } from \"@fluidframework/common-utils\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { ChildLogger } from \"@fluidframework/telemetry-utils\";\nimport EventEmitter from \"events\";\n\nexport class BatchTracker {\n private readonly logger: ITelemetryLogger;\n private startBatchSequenceNumber: number | undefined;\n private trackedBatchCount: number = 0;\n private batchProcessingStartTimeStamp: number | undefined;\n\n constructor(\n private readonly batchEventEmitter: EventEmitter,\n logger: ITelemetryLogger,\n batchLengthThreshold: number,\n batchCountSamplingRate: number,\n dateTimeProvider: () => number = () => performance.now(),\n ) {\n this.logger = ChildLogger.create(logger, \"Batching\");\n\n this.batchEventEmitter.on(\"batchBegin\", (message: ISequencedDocumentMessage) => {\n this.startBatchSequenceNumber = message.sequenceNumber;\n this.batchProcessingStartTimeStamp = dateTimeProvider();\n this.trackedBatchCount++;\n });\n\n this.batchEventEmitter.on(\"batchEnd\", (error: any | undefined, message: ISequencedDocumentMessage) => {\n assert(\n this.startBatchSequenceNumber !== undefined && this.batchProcessingStartTimeStamp !== undefined,\n 0x2ba /* \"batchBegin must fire before batchEnd\" */);\n\n const length = message.sequenceNumber - this.startBatchSequenceNumber + 1;\n if (length >= batchLengthThreshold) {\n this.logger.sendErrorEvent({\n eventName: \"LengthTooBig\",\n length,\n threshold: batchLengthThreshold,\n batchEndSequenceNumber: message.sequenceNumber,\n duration: dateTimeProvider() - this.batchProcessingStartTimeStamp,\n batchError: error !== undefined,\n });\n }\n\n if (this.trackedBatchCount % batchCountSamplingRate === 0) {\n this.logger.sendPerformanceEvent({\n eventName: \"Length\",\n length,\n samplingRate: batchCountSamplingRate,\n batchEndSequenceNumber: message.sequenceNumber,\n duration: dateTimeProvider() - this.batchProcessingStartTimeStamp,\n });\n }\n\n this.startBatchSequenceNumber = undefined;\n this.batchProcessingStartTimeStamp = undefined;\n });\n }\n}\n\n/**\n * Track batch sizes in terms of op counts and processing times\n *\n * @param batchEventEmitter - event emitter which tracks the lifecycle of batch operations\n * @param logger - logger\n * @param batchLengthThreshold - threshold for the length of a batch when to send an error event\n * @param batchCountSamplingRate - rate for batches for which to send an event with its characteristics\n * @returns\n */\nexport const BindBatchTracker = (\n batchEventEmitter: EventEmitter,\n logger: ITelemetryLogger,\n batchLengthThreshold: number = 128,\n batchCountSamplingRate: number = 1000,\n) => new BatchTracker(batchEventEmitter, logger, batchLengthThreshold, batchCountSamplingRate)\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,16 @@ 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 _maxOpSizeInBytes;
|
|
218
|
+
private readonly maxConsecutiveReconnects;
|
|
219
|
+
private readonly defaultMaxConsecutiveReconnects;
|
|
218
220
|
private _orderSequentiallyCalls;
|
|
219
221
|
private _flushMode;
|
|
220
222
|
private needsFlush;
|
|
221
223
|
private flushTrigger;
|
|
222
224
|
private _connected;
|
|
223
225
|
private paused;
|
|
226
|
+
private consecutiveReconnects;
|
|
224
227
|
get connected(): boolean;
|
|
225
228
|
/** clientId of parent (non-summarizing) container that owns summarizer container */
|
|
226
229
|
get summarizerClientId(): string | undefined;
|
|
@@ -229,7 +232,6 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
229
232
|
get disposed(): boolean;
|
|
230
233
|
private dirtyContainer;
|
|
231
234
|
private emitDirtyDocumentEvent;
|
|
232
|
-
private readonly summarizerWarning;
|
|
233
235
|
/**
|
|
234
236
|
* Summarizer is responsible for coordinating when to send generate and send summaries.
|
|
235
237
|
* It is the main entry point for summary work.
|
|
@@ -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;
|
|
@@ -424,6 +428,7 @@ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntim
|
|
|
424
428
|
submitDataStoreAliasOp(contents: any, localOpMetadata: unknown): void;
|
|
425
429
|
uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;
|
|
426
430
|
private submit;
|
|
431
|
+
private submitMaybeChunkedMessages;
|
|
427
432
|
private submitChunkedMessage;
|
|
428
433
|
private submitSystemMessage;
|
|
429
434
|
private submitRuntimeMessage;
|
|
@@ -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,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B,CAAC;IAiMxF,OAAO,CAAC,2BAA2B;IAoBnC,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,wBAAwB;IAYzB,iBAAiB,CACpB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,GAAG,EACb,eAAe,GAAE,OAAmB,GAAG,IAAI;IAQxC,sBAAsB,CAAC,QAAQ,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;IAS/D,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IAKtF,OAAO,CAAC,MAAM;IA8Dd,OAAO,CAAC,0BAA0B;IA0ClC,OAAO,CAAC,oBAAoB;IAqB5B,OAAO,CAAC,mBAAmB;IAoB3B,OAAO,CAAC,oBAAoB;IAgB5B;;;OAGG;IACH,OAAO,CAAC,eAAe;IAMvB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IA6BhB,6EAA6E;IAChE,uBAAuB,CAChC,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,gBAAgB;IAoBnC;;;;;OAKG;YACW,iCAAiC;YAuBjC,wBAAwB;IAwB/B,oBAAoB;IAI3B,SAAgB,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAajE;IAEF,SAAgB,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAa/D;IAEF;;;SAGK;IACL,OAAO,CAAC,uBAAuB;CAyBlC"}
|
package/dist/containerRuntime.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
3
|
exports.ContainerRuntime = exports.getDeviceSpec = exports.agentSchedulerId = exports.ScheduleManager = exports.unpackRuntimeMessage = exports.isRuntimeMessage = exports.RuntimeMessage = exports.RuntimeHeaders = exports.ContainerMessageType = void 0;
|
|
8
4
|
const container_definitions_1 = require("@fluidframework/container-definitions");
|
|
@@ -33,6 +29,7 @@ const throttler_1 = require("./throttler");
|
|
|
33
29
|
const runWhileConnectedCoordinator_1 = require("./runWhileConnectedCoordinator");
|
|
34
30
|
const garbageCollection_1 = require("./garbageCollection");
|
|
35
31
|
const dataStore_1 = require("./dataStore");
|
|
32
|
+
const batchTracker_1 = require("./batchTracker");
|
|
36
33
|
var ContainerMessageType;
|
|
37
34
|
(function (ContainerMessageType) {
|
|
38
35
|
// An op to be delivered to store
|
|
@@ -75,9 +72,16 @@ var RuntimeHeaders;
|
|
|
75
72
|
/** True if the request is coming from an IFluidHandle. */
|
|
76
73
|
RuntimeHeaders["viaHandle"] = "viaHandle";
|
|
77
74
|
})(RuntimeHeaders = exports.RuntimeHeaders || (exports.RuntimeHeaders = {}));
|
|
78
|
-
// Local storage key to set the default flush mode to TurnBased
|
|
79
|
-
const turnBasedFlushModeKey = "Fluid.ContainerRuntime.FlushModeTurnBased";
|
|
80
75
|
const useDataStoreAliasingKey = "Fluid.ContainerRuntime.UseDataStoreAliasing";
|
|
76
|
+
const maxConsecutiveReconnectsKey = "Fluid.ContainerRuntime.MaxConsecutiveReconnects";
|
|
77
|
+
// Feature gate for the max op size. If the value is negative, chunking is enabled
|
|
78
|
+
// and all ops over 16k would be chunked. If the value is positive, all ops with
|
|
79
|
+
// a size strictly larger will be rejected and the container closed with an error.
|
|
80
|
+
const maxOpSizeInBytesKey = "Fluid.ContainerRuntime.MaxOpSizeInBytes";
|
|
81
|
+
// By default, we should reject any op larger than 768KB,
|
|
82
|
+
// in order to account for some extra overhead from serialization
|
|
83
|
+
// to not reach the 1MB limits in socket.io and Kafka.
|
|
84
|
+
const defaultMaxOpSizeInBytes = 768000;
|
|
81
85
|
var RuntimeMessage;
|
|
82
86
|
(function (RuntimeMessage) {
|
|
83
87
|
RuntimeMessage["FluidDataStoreOp"] = "component";
|
|
@@ -355,7 +359,7 @@ exports.getDeviceSpec = getDeviceSpec;
|
|
|
355
359
|
*/
|
|
356
360
|
class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
357
361
|
constructor(context, registry, metadata, electedSummarizerData, chunks, dataStoreAliasMap, runtimeOptions, containerScope, logger, existing, blobManagerSnapshot, requestHandler, _storage) {
|
|
358
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
362
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
359
363
|
super();
|
|
360
364
|
this.context = context;
|
|
361
365
|
this.registry = registry;
|
|
@@ -364,13 +368,15 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
364
368
|
this.logger = logger;
|
|
365
369
|
this.requestHandler = requestHandler;
|
|
366
370
|
this._storage = _storage;
|
|
371
|
+
this.defaultMaxConsecutiveReconnects = 15;
|
|
367
372
|
this._orderSequentiallyCalls = 0;
|
|
373
|
+
this._flushMode = runtime_definitions_1.FlushMode.TurnBased;
|
|
368
374
|
this.needsFlush = false;
|
|
369
375
|
this.flushTrigger = false;
|
|
370
376
|
this.paused = false;
|
|
377
|
+
this.consecutiveReconnects = 0;
|
|
371
378
|
this._disposed = false;
|
|
372
379
|
this.emitDirtyDocumentEvent = true;
|
|
373
|
-
this.summarizerWarning = (warning) => this.mc.logger.sendTelemetryEvent({ eventName: "summarizerWarning" }, warning);
|
|
374
380
|
/**
|
|
375
381
|
* Used to apply stashed ops at their reference sequence number.
|
|
376
382
|
* Normal op processing is synchronous, but applying stashed ops is async since the
|
|
@@ -442,11 +448,11 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
442
448
|
this.chunkMap = new Map(chunks);
|
|
443
449
|
this.handleContext = new containerHandleContext_1.ContainerFluidHandleContext("", this);
|
|
444
450
|
this.mc = telemetry_utils_1.loggerToMonitoringContext(telemetry_utils_1.ChildLogger.create(this.logger, "ContainerRuntime"));
|
|
445
|
-
this._flushMode =
|
|
446
|
-
((_b = this.mc.config.getBoolean(turnBasedFlushModeKey)) !== null && _b !== void 0 ? _b : false) ? runtime_definitions_1.FlushMode.TurnBased : runtime_definitions_1.FlushMode.Immediate;
|
|
447
451
|
this._aliasingEnabled =
|
|
448
|
-
((
|
|
449
|
-
((
|
|
452
|
+
((_b = this.mc.config.getBoolean(useDataStoreAliasingKey)) !== null && _b !== void 0 ? _b : false) ||
|
|
453
|
+
((_c = runtimeOptions.useDataStoreAliasing) !== null && _c !== void 0 ? _c : false);
|
|
454
|
+
this._maxOpSizeInBytes = ((_d = this.mc.config.getNumber(maxOpSizeInBytesKey)) !== null && _d !== void 0 ? _d : defaultMaxOpSizeInBytes);
|
|
455
|
+
this.maxConsecutiveReconnects = (_e = this.mc.config.getNumber(maxConsecutiveReconnectsKey)) !== null && _e !== void 0 ? _e : this.defaultMaxConsecutiveReconnects;
|
|
450
456
|
this.garbageCollector = garbageCollection_1.GarbageCollector.create(this, this.runtimeOptions.gcOptions, (unusedRoutes) => this.dataStores.deleteUnusedRoutes(unusedRoutes), (nodePath) => this.dataStores.getNodePackagePath(nodePath),
|
|
451
457
|
/**
|
|
452
458
|
* Returns the timestamp of the last message seen by this client. This is used by garbage collector as
|
|
@@ -484,7 +490,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
484
490
|
this.summaryCollection = new summaryCollection_1.SummaryCollection(this.deltaManager, this.logger);
|
|
485
491
|
const { attachState, pendingLocalState } = this.context;
|
|
486
492
|
this.dirtyContainer = attachState !== container_definitions_1.AttachState.Attached
|
|
487
|
-
|| ((
|
|
493
|
+
|| ((_f = pendingLocalState) === null || _f === void 0 ? void 0 : _f.pendingStates.length) > 0;
|
|
488
494
|
this.context.updateDirtyContainerState(this.dirtyContainer);
|
|
489
495
|
// Map the deprecated generateSummaries flag to disableSummaries.
|
|
490
496
|
if (this.runtimeOptions.summaryOptions.generateSummaries === false) {
|
|
@@ -497,8 +503,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
497
503
|
const orderedClientLogger = telemetry_utils_1.ChildLogger.create(this.logger, "OrderedClientElection");
|
|
498
504
|
const orderedClientCollection = new orderedClientElection_1.OrderedClientCollection(orderedClientLogger, this.context.deltaManager, this.context.quorum);
|
|
499
505
|
const orderedClientElectionForSummarizer = new orderedClientElection_1.OrderedClientElection(orderedClientLogger, orderedClientCollection, electedSummarizerData !== null && electedSummarizerData !== void 0 ? electedSummarizerData : this.context.deltaManager.lastSequenceNumber, summarizerClientElection_1.SummarizerClientElection.isClientEligible);
|
|
500
|
-
const summarizerClientElectionEnabled = (
|
|
501
|
-
const maxOpsSinceLastSummary = (
|
|
506
|
+
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;
|
|
507
|
+
const maxOpsSinceLastSummary = (_j = this.runtimeOptions.summaryOptions.maxOpsSinceLastSummary) !== null && _j !== void 0 ? _j : 7000;
|
|
502
508
|
this.summarizerClientElection = new summarizerClientElection_1.SummarizerClientElection(orderedClientLogger, this.summaryCollection, orderedClientElectionForSummarizer, maxOpsSinceLastSummary, summarizerClientElectionEnabled);
|
|
503
509
|
if (this.context.clientDetails.type === summarizerClientElection_1.summarizerClientType) {
|
|
504
510
|
this._summarizer = new summarizer_1.Summarizer("/_summarizer", this /* ISummarizerRuntime */, () => this.summaryConfiguration, this /* ISummarizerInternalsProvider */, this.handleContext, this.summaryCollection, async (runtime) => runWhileConnectedCoordinator_1.RunWhileConnectedCoordinator.create(runtime));
|
|
@@ -530,7 +536,6 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
530
536
|
throttler_1.formExponentialFn({ coefficient: 20, initialDelay: 0 })), {
|
|
531
537
|
initialDelayMs: this.runtimeOptions.summaryOptions.initialSummarizerDelayMs,
|
|
532
538
|
}, this.runtimeOptions.summaryOptions.summarizerOptions);
|
|
533
|
-
this.summaryManager.on("summarizerWarning", this.summarizerWarning);
|
|
534
539
|
this.summaryManager.start();
|
|
535
540
|
}
|
|
536
541
|
}
|
|
@@ -561,6 +566,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
561
566
|
// logging container load stats
|
|
562
567
|
this.logger.sendTelemetryEvent(Object.assign(Object.assign(Object.assign({ eventName: "ContainerLoadStats" }, this.createContainerMetadata), this.dataStores.containerLoadStats), { summaryCount: this.summaryCount, summaryFormatVersion: metadata === null || metadata === void 0 ? void 0 : metadata.summaryFormatVersion, disableIsolatedChannels: metadata === null || metadata === void 0 ? void 0 : metadata.disableIsolatedChannels, gcVersion: metadata === null || metadata === void 0 ? void 0 : metadata.gcFeature }));
|
|
563
568
|
connectionTelemetry_1.ReportOpPerfTelemetry(this.context.clientId, this.deltaManager, this.logger);
|
|
569
|
+
batchTracker_1.BindBatchTracker(this, this.logger);
|
|
564
570
|
}
|
|
565
571
|
get IContainerRuntime() { return this; }
|
|
566
572
|
get IFluidRouter() { return this; }
|
|
@@ -576,7 +582,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
576
582
|
var _a, _b, _c;
|
|
577
583
|
// If taggedLogger exists, use it. Otherwise, wrap the vanilla logger:
|
|
578
584
|
// back-compat: Remove the TaggedLoggerAdapter fallback once all the host are using loader > 0.45
|
|
579
|
-
const
|
|
585
|
+
const backCompatContext = context;
|
|
586
|
+
const passLogger = (_a = backCompatContext.taggedLogger) !== null && _a !== void 0 ? _a : new telemetry_utils_1.TaggedLoggerAdapter(backCompatContext.logger);
|
|
580
587
|
const logger = telemetry_utils_1.ChildLogger.create(passLogger, undefined, {
|
|
581
588
|
all: {
|
|
582
589
|
runtimeVersion: packageVersion_1.pkgVersion,
|
|
@@ -637,7 +644,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
637
644
|
// Unless bypass is explicitly set, then take action when sequence numbers mismatch.
|
|
638
645
|
if (loadSequenceNumberVerification !== "bypass" && runtimeSequenceNumber !== protocolSequenceNumber) {
|
|
639
646
|
// "Load from summary, runtime metadata sequenceNumber !== initialSequenceNumber"
|
|
640
|
-
const error = new container_utils_1.DataCorruptionError("
|
|
647
|
+
const error = new container_utils_1.DataCorruptionError("Summary metadata mismatch", { runtimeSequenceNumber, protocolSequenceNumber });
|
|
641
648
|
if (loadSequenceNumberVerification === "log") {
|
|
642
649
|
logger.sendErrorEvent({ eventName: "SequenceNumberMismatch" }, error);
|
|
643
650
|
}
|
|
@@ -739,7 +746,6 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
739
746
|
attachState: this.attachState,
|
|
740
747
|
}, error);
|
|
741
748
|
if (this.summaryManager !== undefined) {
|
|
742
|
-
this.summaryManager.off("summarizerWarning", this.summarizerWarning);
|
|
743
749
|
this.summaryManager.dispose();
|
|
744
750
|
}
|
|
745
751
|
this.garbageCollector.dispose();
|
|
@@ -884,6 +890,37 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
884
890
|
}
|
|
885
891
|
}
|
|
886
892
|
}
|
|
893
|
+
// Track how many times the container tries to reconnect with pending messages.
|
|
894
|
+
// This happens when the connection state is changed and we reset the counter
|
|
895
|
+
// when we are able to process a local op or when there are no pending messages.
|
|
896
|
+
// If this counter reaches a max, it's a good indicator that the container
|
|
897
|
+
// is not making progress and it is stuck in a retry loop.
|
|
898
|
+
shouldContinueReconnecting() {
|
|
899
|
+
if (this.maxConsecutiveReconnects <= 0) {
|
|
900
|
+
// Feature disabled, we never stop reconnecting
|
|
901
|
+
return true;
|
|
902
|
+
}
|
|
903
|
+
if (!this.pendingStateManager.hasPendingMessages()) {
|
|
904
|
+
// If there are no pending messages, we can always reconnect
|
|
905
|
+
this.resetReconnectCount();
|
|
906
|
+
return true;
|
|
907
|
+
}
|
|
908
|
+
this.consecutiveReconnects++;
|
|
909
|
+
if (this.consecutiveReconnects === Math.floor(this.maxConsecutiveReconnects / 2)) {
|
|
910
|
+
// If we're halfway through the max reconnects, send an event in order
|
|
911
|
+
// to better identify false positives, if any. If the rate of this event
|
|
912
|
+
// matches Container Close count below, we can safely cut down
|
|
913
|
+
// maxConsecutiveReconnects to half.
|
|
914
|
+
this.mc.logger.sendTelemetryEvent({
|
|
915
|
+
eventName: "ReconnectsWithNoProgress",
|
|
916
|
+
attempts: this.consecutiveReconnects,
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
return this.consecutiveReconnects < this.maxConsecutiveReconnects;
|
|
920
|
+
}
|
|
921
|
+
resetReconnectCount() {
|
|
922
|
+
this.consecutiveReconnects = 0;
|
|
923
|
+
}
|
|
887
924
|
replayPendingStates() {
|
|
888
925
|
// We need to be able to send ops to replay states
|
|
889
926
|
if (!this.canSendOps()) {
|
|
@@ -936,6 +973,11 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
936
973
|
if (changeOfState) {
|
|
937
974
|
this.deltaManager.off("op", this.onOp);
|
|
938
975
|
this.context.pendingLocalState = undefined;
|
|
976
|
+
if (!this.shouldContinueReconnecting()) {
|
|
977
|
+
this.closeFn(new container_utils_1.GenericError("Runtime detected too many reconnects with no progress syncing local ops", undefined, // error
|
|
978
|
+
{ attempts: this.consecutiveReconnects }));
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
939
981
|
this.replayPendingStates();
|
|
940
982
|
}
|
|
941
983
|
this.dataStores.setConnectionState(connected, clientId);
|
|
@@ -988,6 +1030,12 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
988
1030
|
}
|
|
989
1031
|
this.emit("op", message);
|
|
990
1032
|
this.scheduleManager.afterOpProcessing(undefined, message);
|
|
1033
|
+
if (local) {
|
|
1034
|
+
// If we have processed a local op, this means that the container is
|
|
1035
|
+
// making progress and we can reset the counter for how many times
|
|
1036
|
+
// we have consecutively replayed the pending states
|
|
1037
|
+
this.resetReconnectCount();
|
|
1038
|
+
}
|
|
991
1039
|
}
|
|
992
1040
|
catch (e) {
|
|
993
1041
|
this.scheduleManager.afterOpProcessing(e, message);
|
|
@@ -1072,7 +1120,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1072
1120
|
callback();
|
|
1073
1121
|
}
|
|
1074
1122
|
catch (error) {
|
|
1075
|
-
this.closeFn(new container_utils_1.GenericError("
|
|
1123
|
+
this.closeFn(new container_utils_1.GenericError("orderSequentially callback exception", error));
|
|
1076
1124
|
throw error; // throw the original error for the consumer of the runtime
|
|
1077
1125
|
}
|
|
1078
1126
|
finally {
|
|
@@ -1115,7 +1163,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1115
1163
|
const dataStore = await this._createDataStore(pkg, false /* isRoot */, internalId, props);
|
|
1116
1164
|
const aliasedDataStore = dataStore_1.channelToDataStore(dataStore, internalId, this, this.dataStores, this.mc.logger);
|
|
1117
1165
|
const result = await aliasedDataStore.trySetAlias(alias);
|
|
1118
|
-
if (result !==
|
|
1166
|
+
if (result !== "Success") {
|
|
1119
1167
|
throw new container_utils_1.GenericError("dataStoreAliasFailure", undefined /* error */, {
|
|
1120
1168
|
alias: {
|
|
1121
1169
|
value: alias,
|
|
@@ -1147,7 +1195,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1147
1195
|
if (isRoot) {
|
|
1148
1196
|
fluidDataStore.bindToContext();
|
|
1149
1197
|
}
|
|
1150
|
-
return fluidDataStore;
|
|
1198
|
+
return dataStore_1.channelToDataStore(fluidDataStore, id, this, this.dataStores, this.mc.logger);
|
|
1151
1199
|
}
|
|
1152
1200
|
async _createDataStoreWithProps(pkg, props, id = uuid_1.v4(), isRoot = false) {
|
|
1153
1201
|
return this._aliasingEnabled === true && isRoot ?
|
|
@@ -1329,7 +1377,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1329
1377
|
* @param options - options controlling how the summary is generated or submitted
|
|
1330
1378
|
*/
|
|
1331
1379
|
async submitSummary(options) {
|
|
1332
|
-
var _a, _b;
|
|
1380
|
+
var _a, _b, _c;
|
|
1333
1381
|
const { fullTree, refreshLatestAck, summaryLogger } = options;
|
|
1334
1382
|
if (refreshLatestAck) {
|
|
1335
1383
|
const latestSummaryRefSeq = await this.refreshLatestSummaryAckFromServer(telemetry_utils_1.ChildLogger.create(summaryLogger, undefined, { all: { safeSummary: true } }));
|
|
@@ -1347,6 +1395,14 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1347
1395
|
await this.deltaManager.inbound.pause();
|
|
1348
1396
|
const summaryRefSeqNum = this.deltaManager.lastSequenceNumber;
|
|
1349
1397
|
const message = `Summary @${summaryRefSeqNum}:${this.deltaManager.minimumSequenceNumber}`;
|
|
1398
|
+
// We should be here is we haven't processed be here. If we are of if the last message's sequence number
|
|
1399
|
+
// doesn't match the last processed sequence number, log an error.
|
|
1400
|
+
if (summaryRefSeqNum !== ((_a = this.deltaManager.lastMessage) === null || _a === void 0 ? void 0 : _a.sequenceNumber)) {
|
|
1401
|
+
summaryLogger.sendErrorEvent({
|
|
1402
|
+
eventName: "LastSequenceMismatch",
|
|
1403
|
+
message,
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1350
1406
|
this.summarizerNode.startSummary(summaryRefSeqNum, summaryLogger);
|
|
1351
1407
|
// Helper function to check whether we should still continue between each async step.
|
|
1352
1408
|
const checkContinue = () => {
|
|
@@ -1411,7 +1467,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1411
1467
|
const dataStoreTree = this.disableIsolatedChannels ? summaryTree : summaryTree.tree[runtime_definitions_1.channelsTreeName];
|
|
1412
1468
|
common_utils_1.assert(dataStoreTree.type === protocol_definitions_1.SummaryType.Tree, 0x1fc /* "summary is not a tree" */);
|
|
1413
1469
|
const handleCount = Object.values(dataStoreTree.tree).filter((value) => value.type === protocol_definitions_1.SummaryType.Handle).length;
|
|
1414
|
-
const summaryStats = Object.assign({ dataStoreCount: this.dataStores.size, summarizedDataStoreCount: this.dataStores.size - handleCount, gcStateUpdatedDataStoreCount: (
|
|
1470
|
+
const summaryStats = Object.assign({ dataStoreCount: this.dataStores.size, summarizedDataStoreCount: this.dataStores.size - handleCount, gcStateUpdatedDataStoreCount: (_b = summarizeResult.gcStats) === null || _b === void 0 ? void 0 : _b.updatedDataStoreCount }, partialStats);
|
|
1415
1471
|
const generateSummaryData = {
|
|
1416
1472
|
referenceSequenceNumber: summaryRefSeqNum,
|
|
1417
1473
|
summaryTree,
|
|
@@ -1427,7 +1483,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1427
1483
|
const summaryContext = lastAck === undefined
|
|
1428
1484
|
? {
|
|
1429
1485
|
proposalHandle: undefined,
|
|
1430
|
-
ackHandle: (
|
|
1486
|
+
ackHandle: (_c = this.context.getLoadedFromVersion()) === null || _c === void 0 ? void 0 : _c.id,
|
|
1431
1487
|
referenceSequenceNumber: summaryRefSeqNum,
|
|
1432
1488
|
}
|
|
1433
1489
|
: {
|
|
@@ -1558,16 +1614,7 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1558
1614
|
});
|
|
1559
1615
|
}
|
|
1560
1616
|
}
|
|
1561
|
-
|
|
1562
|
-
// there will be a lot of escape characters that can make it up to 2x bigger!
|
|
1563
|
-
// This is Ok, because DeltaManager.shouldSplit() will have 2 * maxMessageSize limit
|
|
1564
|
-
if (!serializedContent || serializedContent.length <= maxOpSize) {
|
|
1565
|
-
clientSequenceNumber = this.submitRuntimeMessage(type, content,
|
|
1566
|
-
/* batch: */ this._flushMode === runtime_definitions_1.FlushMode.TurnBased, opMetadataInternal);
|
|
1567
|
-
}
|
|
1568
|
-
else {
|
|
1569
|
-
clientSequenceNumber = this.submitChunkedMessage(type, serializedContent, maxOpSize);
|
|
1570
|
-
}
|
|
1617
|
+
clientSequenceNumber = this.submitMaybeChunkedMessages(type, content, serializedContent, maxOpSize, this._flushMode === runtime_definitions_1.FlushMode.TurnBased, opMetadataInternal);
|
|
1571
1618
|
}
|
|
1572
1619
|
// Let the PendingStateManager know that a message was submitted.
|
|
1573
1620
|
this.pendingStateManager.onSubmitMessage(type, clientSequenceNumber, this.deltaManager.lastSequenceNumber, content, localOpMetadata, opMetadataInternal);
|
|
@@ -1575,6 +1622,35 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1575
1622
|
this.updateDocumentDirtyState(true);
|
|
1576
1623
|
}
|
|
1577
1624
|
}
|
|
1625
|
+
submitMaybeChunkedMessages(type, content, serializedContent, serverMaxOpSize, batch, opMetadataInternal = undefined) {
|
|
1626
|
+
if (this._maxOpSizeInBytes >= 0) {
|
|
1627
|
+
// Chunking disabled
|
|
1628
|
+
if (!serializedContent || serializedContent.length <= this._maxOpSizeInBytes) {
|
|
1629
|
+
return this.submitRuntimeMessage(type, content, batch, opMetadataInternal);
|
|
1630
|
+
}
|
|
1631
|
+
// When chunking is disabled, we ignore the server max message size
|
|
1632
|
+
// and if the content length is larger than the client configured message size
|
|
1633
|
+
// instead of splitting the content, we will fail by explicitly close the container
|
|
1634
|
+
this.closeFn(new container_utils_1.GenericError("OpTooLarge",
|
|
1635
|
+
/* error */ undefined, {
|
|
1636
|
+
length: {
|
|
1637
|
+
value: serializedContent.length,
|
|
1638
|
+
tag: telemetry_utils_1.TelemetryDataTag.PackageData,
|
|
1639
|
+
},
|
|
1640
|
+
limit: {
|
|
1641
|
+
value: this._maxOpSizeInBytes,
|
|
1642
|
+
tag: telemetry_utils_1.TelemetryDataTag.PackageData,
|
|
1643
|
+
},
|
|
1644
|
+
}));
|
|
1645
|
+
return -1;
|
|
1646
|
+
}
|
|
1647
|
+
// Chunking enabled, fallback on the server's max message size
|
|
1648
|
+
// and split the content accordingly
|
|
1649
|
+
if (!serializedContent || serializedContent.length <= serverMaxOpSize) {
|
|
1650
|
+
return this.submitRuntimeMessage(type, content, batch, opMetadataInternal);
|
|
1651
|
+
}
|
|
1652
|
+
return this.submitChunkedMessage(type, serializedContent, serverMaxOpSize);
|
|
1653
|
+
}
|
|
1578
1654
|
submitChunkedMessage(type, content, maxOpSize) {
|
|
1579
1655
|
const contentLength = content.length;
|
|
1580
1656
|
const chunkN = Math.floor((contentLength - 1) / maxOpSize) + 1;
|
|
@@ -1653,6 +1729,8 @@ class ContainerRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
1653
1729
|
const readAndParseBlob = async (id) => driver_utils_1.readAndParse(this.storage, id);
|
|
1654
1730
|
const result = await this.summarizerNode.refreshLatestSummary(proposalHandle, summaryRefSeq, async () => this.fetchSnapshotFromStorage(ackHandle, summaryLogger, {
|
|
1655
1731
|
eventName: "RefreshLatestSummaryGetSnapshot",
|
|
1732
|
+
ackHandle,
|
|
1733
|
+
summaryRefSeq,
|
|
1656
1734
|
fetchLatest: false,
|
|
1657
1735
|
}), readAndParseBlob, summaryLogger);
|
|
1658
1736
|
// Notify the garbage collector so it can update its latest summary state.
|