@fluidframework/container-runtime 2.0.0-dev.4.4.0.162574 → 2.0.0-dev.5.2.0.169897
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/dist/batchTracker.d.ts +4 -4
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +2 -2
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.js +2 -2
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts +2 -2
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +12 -11
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +42 -15
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts +2 -2
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +1 -1
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +3 -3
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +1 -2
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/deltaScheduler.d.ts +2 -2
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +1 -1
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +2 -2
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +3 -3
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +5 -5
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/id-compressor/idCompressor.d.ts +2 -2
- package/dist/id-compressor/idCompressor.d.ts.map +1 -1
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +2 -2
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts +2 -2
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +3 -6
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +2 -2
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +5 -6
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +2 -2
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +3 -3
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +2 -2
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +7 -3
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +18 -14
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +35 -55
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts +2 -2
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +4 -3
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +3 -18
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +4 -3
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +5 -6
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +2 -3
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +2 -3
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts +3 -2
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.d.ts +2 -2
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +10 -9
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +3 -3
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +6 -6
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +8 -8
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +3 -2
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +2 -2
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +1 -1
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +3 -2
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/batchTracker.d.ts +4 -4
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +2 -2
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.js +2 -2
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +2 -2
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +12 -11
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +42 -15
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts +2 -2
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +1 -1
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +3 -3
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +1 -2
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/deltaScheduler.d.ts +2 -2
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +2 -2
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +3 -3
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +5 -5
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +1 -1
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/id-compressor/idCompressor.d.ts +2 -2
- package/lib/id-compressor/idCompressor.d.ts.map +1 -1
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +2 -2
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts +2 -2
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +3 -6
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +2 -2
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +5 -6
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +2 -2
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +3 -3
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +2 -2
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +7 -3
- package/lib/opLifecycle/outbox.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/pendingStateManager.d.ts +18 -14
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +35 -55
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts +2 -2
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +4 -3
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +3 -18
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +4 -3
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +5 -6
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +2 -3
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +2 -3
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts +3 -2
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.d.ts +2 -2
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +10 -9
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +3 -3
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +6 -6
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +8 -8
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +3 -2
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +2 -2
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +1 -1
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +3 -2
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +1 -1
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +22 -39
- package/src/batchTracker.ts +5 -6
- package/src/blobManager.ts +2 -2
- package/src/connectionTelemetry.ts +4 -5
- package/src/containerRuntime.ts +60 -31
- package/src/dataStore.ts +3 -4
- package/src/dataStoreContext.ts +4 -8
- package/src/dataStoreContexts.ts +3 -7
- package/src/deltaScheduler.ts +2 -3
- package/src/gc/garbageCollection.ts +5 -5
- package/src/gc/gcDefinitions.ts +3 -3
- package/src/gc/gcTelemetry.ts +9 -5
- package/src/id-compressor/idCompressor.ts +2 -2
- package/src/opLifecycle/definitions.ts +2 -2
- package/src/opLifecycle/opCompressor.ts +4 -8
- package/src/opLifecycle/opDecompressor.ts +2 -3
- package/src/opLifecycle/opGroupingManager.ts +6 -7
- package/src/opLifecycle/opSplitter.ts +4 -5
- package/src/opLifecycle/outbox.ts +10 -9
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +60 -91
- package/src/scheduleManager.ts +3 -4
- package/src/summary/orderedClientElection.ts +7 -20
- package/src/summary/runningSummarizer.ts +11 -10
- package/src/summary/summarizer.ts +8 -8
- package/src/summary/summarizerClientElection.ts +3 -2
- package/src/summary/summarizerHeuristics.ts +2 -2
- package/src/summary/summarizerNode/summarizerNode.ts +15 -14
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +3 -3
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +10 -7
- package/src/summary/summarizerTypes.ts +8 -13
- package/src/summary/summaryCollection.ts +3 -2
- package/src/summary/summaryGenerator.ts +7 -3
- package/src/summary/summaryManager.ts +8 -9
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
import { decompress } from "lz4js";
|
|
7
7
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
8
|
import { assert, IsoBuffer, Uint8ArrayToString } from "@fluidframework/common-utils";
|
|
9
|
-
import { ChildLogger } from "@fluidframework/telemetry-utils";
|
|
10
|
-
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
9
|
+
import { ChildLogger, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
11
10
|
import { CompressionAlgorithms } from "../containerRuntime";
|
|
12
11
|
import { IMessageProcessingResult } from "./definitions";
|
|
13
12
|
|
|
@@ -25,7 +24,7 @@ export class OpDecompressor {
|
|
|
25
24
|
private processedCount = 0;
|
|
26
25
|
private readonly logger;
|
|
27
26
|
|
|
28
|
-
constructor(logger:
|
|
27
|
+
constructor(logger: ITelemetryLoggerExt) {
|
|
29
28
|
this.logger = ChildLogger.create(logger, "OpDecompressor");
|
|
30
29
|
}
|
|
31
30
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/common-utils";
|
|
7
7
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { ContainerMessageType
|
|
8
|
+
import { ContainerMessageType } from "..";
|
|
9
9
|
import { IBatch } from "./definitions";
|
|
10
10
|
|
|
11
11
|
interface IGroupedMessage {
|
|
@@ -26,7 +26,7 @@ export class OpGroupingManager {
|
|
|
26
26
|
|
|
27
27
|
for (const message of batch.content) {
|
|
28
28
|
// Blob attaches cannot be grouped (grouped batching would hide metadata)
|
|
29
|
-
if (message.
|
|
29
|
+
if (message.type === ContainerMessageType.BlobAttach) {
|
|
30
30
|
return batch;
|
|
31
31
|
}
|
|
32
32
|
if (message.metadata) {
|
|
@@ -39,14 +39,14 @@ export class OpGroupingManager {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
const
|
|
42
|
+
const serializedContent = JSON.stringify({
|
|
43
43
|
type: OpGroupingManager.groupedBatchOp,
|
|
44
44
|
contents: batch.content.map<IGroupedMessage>((message) => ({
|
|
45
45
|
contents: message.contents === undefined ? undefined : JSON.parse(message.contents),
|
|
46
46
|
metadata: message.metadata,
|
|
47
47
|
compression: message.compression,
|
|
48
48
|
})),
|
|
49
|
-
};
|
|
49
|
+
});
|
|
50
50
|
|
|
51
51
|
const groupedBatch: IBatch = {
|
|
52
52
|
...batch,
|
|
@@ -55,9 +55,8 @@ export class OpGroupingManager {
|
|
|
55
55
|
localOpMetadata: undefined,
|
|
56
56
|
metadata: undefined,
|
|
57
57
|
referenceSequenceNumber: batch.content[0].referenceSequenceNumber,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
contents: JSON.stringify(deserializedContent),
|
|
58
|
+
contents: serializedContent,
|
|
59
|
+
type: OpGroupingManager.groupedBatchOp as ContainerMessageType,
|
|
61
60
|
},
|
|
62
61
|
],
|
|
63
62
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { ITelemetryLoggerExt, ChildLogger } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import { assert } from "@fluidframework/common-utils";
|
|
8
8
|
import { IBatchMessage } from "@fluidframework/container-definitions";
|
|
9
9
|
import {
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
extractSafePropertiesFromMessage,
|
|
12
12
|
} from "@fluidframework/container-utils";
|
|
13
13
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
14
|
-
import { ChildLogger } from "@fluidframework/telemetry-utils";
|
|
15
14
|
import { ContainerMessageType, ContainerRuntimeMessage } from "../containerRuntime";
|
|
16
15
|
import { estimateSocketSize } from "./batchManager";
|
|
17
16
|
import { BatchMessage, IBatch, IChunkedOp, IMessageProcessingResult } from "./definitions";
|
|
@@ -31,7 +30,7 @@ export class OpSplitter {
|
|
|
31
30
|
| undefined,
|
|
32
31
|
public readonly chunkSizeInBytes: number,
|
|
33
32
|
private readonly maxBatchSizeInBytes: number,
|
|
34
|
-
logger:
|
|
33
|
+
logger: ITelemetryLoggerExt,
|
|
35
34
|
) {
|
|
36
35
|
this.chunkMap = new Map<string, string[]>(chunks);
|
|
37
36
|
this.logger = ChildLogger.create(logger, "OpSplitter");
|
|
@@ -214,7 +213,7 @@ const chunkToBatchMessage = (
|
|
|
214
213
|
};
|
|
215
214
|
return {
|
|
216
215
|
contents: JSON.stringify(payload),
|
|
217
|
-
|
|
216
|
+
type: payload.type,
|
|
218
217
|
metadata,
|
|
219
218
|
localOpMetadata: undefined,
|
|
220
219
|
referenceSequenceNumber,
|
|
@@ -251,7 +250,7 @@ export const splitOp = (
|
|
|
251
250
|
const chunk: IChunkedOp = {
|
|
252
251
|
chunkId,
|
|
253
252
|
contents: op.contents.substr(offset, chunkSizeInBytes),
|
|
254
|
-
originalType: op.
|
|
253
|
+
originalType: op.type,
|
|
255
254
|
totalChunks: chunkCount,
|
|
256
255
|
};
|
|
257
256
|
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
7
|
-
import { assert } from "@fluidframework/common-utils";
|
|
8
|
-
import { IContainerContext } from "@fluidframework/container-definitions";
|
|
9
|
-
import { GenericError, UsageError } from "@fluidframework/container-utils";
|
|
10
|
-
import { MessageType } from "@fluidframework/protocol-definitions";
|
|
11
6
|
import {
|
|
7
|
+
ITelemetryLoggerExt,
|
|
12
8
|
ChildLogger,
|
|
13
9
|
loggerToMonitoringContext,
|
|
14
10
|
MonitoringContext,
|
|
15
11
|
} from "@fluidframework/telemetry-utils";
|
|
12
|
+
import { assert } from "@fluidframework/common-utils";
|
|
13
|
+
import { IContainerContext } from "@fluidframework/container-definitions";
|
|
14
|
+
import { GenericError, UsageError } from "@fluidframework/container-utils";
|
|
15
|
+
import { MessageType } from "@fluidframework/protocol-definitions";
|
|
16
16
|
import { ICompressionRuntimeOptions } from "../containerRuntime";
|
|
17
17
|
import { PendingStateManager } from "../pendingStateManager";
|
|
18
18
|
import {
|
|
@@ -40,7 +40,7 @@ export interface IOutboxParameters {
|
|
|
40
40
|
readonly config: IOutboxConfig;
|
|
41
41
|
readonly compressor: OpCompressor;
|
|
42
42
|
readonly splitter: OpSplitter;
|
|
43
|
-
readonly logger:
|
|
43
|
+
readonly logger: ITelemetryLoggerExt;
|
|
44
44
|
readonly groupingManager: OpGroupingManager;
|
|
45
45
|
readonly getCurrentSequenceNumbers: () => BatchSequenceNumbers;
|
|
46
46
|
}
|
|
@@ -279,7 +279,8 @@ export class Outbox {
|
|
|
279
279
|
for (const message of batch.content) {
|
|
280
280
|
this.params.containerContext.submitFn(
|
|
281
281
|
MessageType.Operation,
|
|
282
|
-
|
|
282
|
+
// For back-compat (submitFn only works on deserialized content)
|
|
283
|
+
message.contents === undefined ? undefined : JSON.parse(message.contents),
|
|
283
284
|
true, // batch
|
|
284
285
|
message.metadata,
|
|
285
286
|
);
|
|
@@ -308,9 +309,9 @@ export class Outbox {
|
|
|
308
309
|
// In future, need to shift toward keeping batch as a whole!
|
|
309
310
|
for (const message of batch) {
|
|
310
311
|
this.params.pendingStateManager.onSubmitMessage(
|
|
311
|
-
|
|
312
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
313
|
+
message.contents!,
|
|
312
314
|
message.referenceSequenceNumber,
|
|
313
|
-
message.deserializedContent.contents,
|
|
314
315
|
message.localOpMetadata,
|
|
315
316
|
message.metadata,
|
|
316
317
|
);
|
package/src/packageVersion.ts
CHANGED
|
@@ -13,10 +13,9 @@ import { ContainerMessageType } from "./containerRuntime";
|
|
|
13
13
|
import { pkgVersion } from "./packageVersion";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* ContainerRuntime. This message has either not been ack'd by the server or has not been submitted to the server yet.
|
|
16
|
+
* ! TODO: Remove this interface in "2.0.0-internal.7.0.0" once we only read IPendingMessageNew
|
|
18
17
|
*/
|
|
19
|
-
export interface
|
|
18
|
+
export interface IPendingMessageOld {
|
|
20
19
|
type: "message";
|
|
21
20
|
messageType: ContainerMessageType;
|
|
22
21
|
clientSequenceNumber: number;
|
|
@@ -27,16 +26,22 @@ export interface IPendingMessage {
|
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
/**
|
|
30
|
-
* This represents
|
|
31
|
-
* to
|
|
32
|
-
* ! TODO: Remove in "2.0.0-internal.5.0.0" AB#2496
|
|
29
|
+
* This represents a message that has been submitted and is added to the pending queue when `submit` is called on the
|
|
30
|
+
* ContainerRuntime. This message has either not been ack'd by the server or has not been submitted to the server yet.
|
|
33
31
|
*/
|
|
34
|
-
export interface
|
|
35
|
-
type: "
|
|
32
|
+
export interface IPendingMessageNew {
|
|
33
|
+
type: "message";
|
|
34
|
+
clientSequenceNumber: number;
|
|
35
|
+
referenceSequenceNumber: number;
|
|
36
|
+
content: string;
|
|
37
|
+
localOpMetadata: unknown;
|
|
38
|
+
opMetadata: Record<string, unknown> | undefined;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
/**
|
|
39
|
-
|
|
41
|
+
/**
|
|
42
|
+
* ! TODO: Remove this type in "2.0.0-internal.7.0.0"
|
|
43
|
+
*/
|
|
44
|
+
export type IPendingState = IPendingMessageOld | IPendingMessageNew;
|
|
40
45
|
|
|
41
46
|
export interface IPendingLocalState {
|
|
42
47
|
/**
|
|
@@ -49,14 +54,12 @@ export interface IRuntimeStateHandler {
|
|
|
49
54
|
connected(): boolean;
|
|
50
55
|
clientId(): string | undefined;
|
|
51
56
|
close(error?: ICriticalContainerError): void;
|
|
52
|
-
applyStashedOp
|
|
57
|
+
applyStashedOp(content: string): Promise<unknown>;
|
|
53
58
|
reSubmit(
|
|
54
|
-
|
|
55
|
-
content: any,
|
|
59
|
+
content: string | undefined,
|
|
56
60
|
localOpMetadata: unknown,
|
|
57
61
|
opMetadata: Record<string, unknown> | undefined,
|
|
58
62
|
): void;
|
|
59
|
-
rollback(type: ContainerMessageType, content: any, localOpMetadata: unknown): void;
|
|
60
63
|
orderSequentially(callback: () => void): void;
|
|
61
64
|
}
|
|
62
65
|
|
|
@@ -70,8 +73,8 @@ export interface IRuntimeStateHandler {
|
|
|
70
73
|
* It verifies that all the ops are acked, are received in the right order and batch information is correct.
|
|
71
74
|
*/
|
|
72
75
|
export class PendingStateManager implements IDisposable {
|
|
73
|
-
private readonly pendingMessages = new Deque<
|
|
74
|
-
private readonly initialMessages = new Deque<
|
|
76
|
+
private readonly pendingMessages = new Deque<IPendingMessageNew>();
|
|
77
|
+
private readonly initialMessages = new Deque<IPendingMessageNew>();
|
|
75
78
|
private readonly disposeOnce = new Lazy<void>(() => {
|
|
76
79
|
this.initialMessages.clear();
|
|
77
80
|
this.pendingMessages.clear();
|
|
@@ -105,22 +108,23 @@ export class PendingStateManager implements IDisposable {
|
|
|
105
108
|
);
|
|
106
109
|
if (!this.pendingMessages.isEmpty()) {
|
|
107
110
|
return {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
pendingStates: this.pendingMessages.toArray().map((message) => {
|
|
112
|
+
// ! TODO: Remove conversion to IPendingMessageOld in "2.0.0-internal.6.0.0" AB#3826
|
|
113
|
+
const content = JSON.parse(message.content);
|
|
111
114
|
// IdAllocations need their localOpMetadata stashed in the contents
|
|
112
115
|
// of the op to correctly resume the session when processing stashed ops
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
if (content.type === ContainerMessageType.IdAllocation) {
|
|
117
|
+
content.contents.stashedState = message.localOpMetadata;
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
...message,
|
|
121
|
+
messageType: content.type,
|
|
122
|
+
content: content.contents,
|
|
123
|
+
// delete localOpMetadata since it may not be serializable
|
|
124
|
+
// and will be regenerated by applyStashedOp()
|
|
125
|
+
localOpMetadata: undefined,
|
|
126
|
+
};
|
|
127
|
+
}),
|
|
124
128
|
};
|
|
125
129
|
}
|
|
126
130
|
}
|
|
@@ -130,34 +134,27 @@ export class PendingStateManager implements IDisposable {
|
|
|
130
134
|
initialLocalState: IPendingLocalState | undefined,
|
|
131
135
|
) {
|
|
132
136
|
/**
|
|
133
|
-
* Convert old local state format to the new format
|
|
134
|
-
*
|
|
135
|
-
* The new format instead uses batch metadata on the last message to indicate batch ends
|
|
136
|
-
* ! TODO: Remove this conversion in "2.0.0-internal.5.0.0" as version from "2.0.0-internal.4.0.0" will be new format
|
|
137
|
-
* AB#2496 tracks removal
|
|
137
|
+
* Convert old local state format to the new format (IPendingMessageOld to IPendingMessageNew)
|
|
138
|
+
* ! TODO: Remove this conversion in "2.0.0-internal.7.0.0"
|
|
138
139
|
*/
|
|
139
140
|
if (initialLocalState?.pendingStates) {
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
} else if (
|
|
152
|
-
// End of batch if we are currently batching and this is last message or next message is flush
|
|
153
|
-
currentlyBatching &&
|
|
154
|
-
(i === pendingStates.length - 1 || pendingStates[i + 1].type === "flush")
|
|
155
|
-
) {
|
|
156
|
-
currentlyBatching = false;
|
|
157
|
-
initialState.opMetadata = { ...initialState.opMetadata, batch: false };
|
|
158
|
-
}
|
|
159
|
-
this.initialMessages.push(initialState);
|
|
141
|
+
for (const initialState of initialLocalState.pendingStates) {
|
|
142
|
+
let messageContent = initialState.content;
|
|
143
|
+
if (
|
|
144
|
+
(initialState as IPendingMessageOld).messageType !== undefined &&
|
|
145
|
+
typeof initialState.content !== "string"
|
|
146
|
+
) {
|
|
147
|
+
// Convert IPendingMessageOld to IPendingMessageNew
|
|
148
|
+
messageContent = JSON.stringify({
|
|
149
|
+
type: (initialState as IPendingMessageOld).messageType,
|
|
150
|
+
contents: initialState.content,
|
|
151
|
+
});
|
|
160
152
|
}
|
|
153
|
+
// Note: this object may contain "messageType" prop, but it should not be easily accesible due to interface being used
|
|
154
|
+
this.initialMessages.push({
|
|
155
|
+
...initialState,
|
|
156
|
+
content: messageContent,
|
|
157
|
+
});
|
|
161
158
|
}
|
|
162
159
|
}
|
|
163
160
|
}
|
|
@@ -175,15 +172,13 @@ export class PendingStateManager implements IDisposable {
|
|
|
175
172
|
* @param localOpMetadata - The local metadata associated with the message.
|
|
176
173
|
*/
|
|
177
174
|
public onSubmitMessage(
|
|
178
|
-
|
|
175
|
+
content: string,
|
|
179
176
|
referenceSequenceNumber: number,
|
|
180
|
-
content: any,
|
|
181
177
|
localOpMetadata: unknown,
|
|
182
178
|
opMetadata: Record<string, unknown> | undefined,
|
|
183
179
|
) {
|
|
184
|
-
const pendingMessage:
|
|
180
|
+
const pendingMessage: IPendingMessageNew = {
|
|
185
181
|
type: "message",
|
|
186
|
-
messageType: type,
|
|
187
182
|
clientSequenceNumber: -1, // dummy value (not to be used anywhere)
|
|
188
183
|
referenceSequenceNumber,
|
|
189
184
|
content,
|
|
@@ -213,18 +208,9 @@ export class PendingStateManager implements IDisposable {
|
|
|
213
208
|
}
|
|
214
209
|
|
|
215
210
|
// applyStashedOp will cause the DDS to behave as if it has sent the op but not actually send it
|
|
216
|
-
const localOpMetadata = await this.stateHandler.applyStashedOp(
|
|
217
|
-
nextMessage.messageType,
|
|
218
|
-
nextMessage.content,
|
|
219
|
-
);
|
|
211
|
+
const localOpMetadata = await this.stateHandler.applyStashedOp(nextMessage.content);
|
|
220
212
|
nextMessage.localOpMetadata = localOpMetadata;
|
|
221
213
|
|
|
222
|
-
if (nextMessage.messageType === ContainerMessageType.IdAllocation) {
|
|
223
|
-
// Remove the stashed state from the op
|
|
224
|
-
// so that it doesn't go over the wire
|
|
225
|
-
delete nextMessage.content.stashedState;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
214
|
// then we push onto pendingMessages which will cause PendingStateManager to resubmit when we connect
|
|
229
215
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
230
216
|
this.pendingMessages.push(this.initialMessages.shift()!);
|
|
@@ -248,32 +234,17 @@ export class PendingStateManager implements IDisposable {
|
|
|
248
234
|
);
|
|
249
235
|
this.pendingMessages.shift();
|
|
250
236
|
|
|
251
|
-
|
|
252
|
-
// Close the container because this could indicate data corruption.
|
|
253
|
-
this.stateHandler.close(
|
|
254
|
-
DataProcessingError.create(
|
|
255
|
-
"pending local message type mismatch",
|
|
256
|
-
"unexpectedAckReceived",
|
|
257
|
-
message,
|
|
258
|
-
{
|
|
259
|
-
expectedMessageType: pendingMessage.messageType,
|
|
260
|
-
},
|
|
261
|
-
),
|
|
262
|
-
);
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
const pendingMessageContent = JSON.stringify(pendingMessage.content);
|
|
267
|
-
const messageContent = JSON.stringify(message.contents);
|
|
268
|
-
|
|
237
|
+
const messageContent = JSON.stringify({ type: message.type, contents: message.contents });
|
|
269
238
|
// Stringified content does not match
|
|
270
|
-
if (
|
|
271
|
-
// Close the container because this could indicate data corruption.
|
|
239
|
+
if (pendingMessage.content !== messageContent) {
|
|
272
240
|
this.stateHandler.close(
|
|
273
241
|
DataProcessingError.create(
|
|
274
242
|
"pending local message content mismatch",
|
|
275
243
|
"unexpectedAckReceived",
|
|
276
244
|
message,
|
|
245
|
+
{
|
|
246
|
+
expectedMessageType: JSON.parse(pendingMessage.content).type,
|
|
247
|
+
},
|
|
277
248
|
),
|
|
278
249
|
);
|
|
279
250
|
return;
|
|
@@ -412,7 +383,6 @@ export class PendingStateManager implements IDisposable {
|
|
|
412
383
|
while (pendingMessagesCount >= 0) {
|
|
413
384
|
// check is >= because batch end may be last pending message
|
|
414
385
|
this.stateHandler.reSubmit(
|
|
415
|
-
pendingMessage.messageType,
|
|
416
386
|
pendingMessage.content,
|
|
417
387
|
pendingMessage.localOpMetadata,
|
|
418
388
|
pendingMessage.opMetadata,
|
|
@@ -434,7 +404,6 @@ export class PendingStateManager implements IDisposable {
|
|
|
434
404
|
});
|
|
435
405
|
} else {
|
|
436
406
|
this.stateHandler.reSubmit(
|
|
437
|
-
pendingMessage.messageType,
|
|
438
407
|
pendingMessage.content,
|
|
439
408
|
pendingMessage.localOpMetadata,
|
|
440
409
|
pendingMessage.opMetadata,
|
package/src/scheduleManager.ts
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
import { EventEmitter } from "events";
|
|
6
6
|
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
7
7
|
import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import {
|
|
9
|
-
import { ChildLogger } from "@fluidframework/telemetry-utils";
|
|
8
|
+
import { ITelemetryLoggerExt, ChildLogger } from "@fluidframework/telemetry-utils";
|
|
10
9
|
import { assert, performance } from "@fluidframework/common-utils";
|
|
11
10
|
import { isRuntimeMessage } from "@fluidframework/driver-utils";
|
|
12
11
|
import {
|
|
@@ -41,7 +40,7 @@ export class ScheduleManager {
|
|
|
41
40
|
private readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
|
|
42
41
|
private readonly emitter: EventEmitter,
|
|
43
42
|
readonly getClientId: () => string | undefined,
|
|
44
|
-
private readonly logger:
|
|
43
|
+
private readonly logger: ITelemetryLoggerExt,
|
|
45
44
|
) {
|
|
46
45
|
this.deltaScheduler = new DeltaScheduler(
|
|
47
46
|
this.deltaManager,
|
|
@@ -106,7 +105,7 @@ class ScheduleManagerCore {
|
|
|
106
105
|
constructor(
|
|
107
106
|
private readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
|
|
108
107
|
private readonly getClientId: () => string | undefined,
|
|
109
|
-
private readonly logger:
|
|
108
|
+
private readonly logger: ITelemetryLoggerExt,
|
|
110
109
|
) {
|
|
111
110
|
// Listen for delta manager sends and add batch metadata to messages
|
|
112
111
|
this.deltaManager.on("prepareSend", (messages: IDocumentMessage[]) => {
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
/* eslint-disable @rushstack/no-new-null */
|
|
6
|
-
import { IEvent, IEventProvider
|
|
6
|
+
import { IEvent, IEventProvider } from "@fluidframework/common-definitions";
|
|
7
|
+
import { ITelemetryLoggerExt, ChildLogger } from "@fluidframework/telemetry-utils";
|
|
7
8
|
import { assert, TypedEventEmitter } from "@fluidframework/common-utils";
|
|
8
9
|
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
9
10
|
import { UsageError } from "@fluidframework/container-utils";
|
|
10
11
|
import { IClient, IQuorumClients, ISequencedClient } from "@fluidframework/protocol-definitions";
|
|
11
|
-
import { ChildLogger } from "@fluidframework/telemetry-utils";
|
|
12
12
|
import { summarizerClientType } from "./summarizerClientElection";
|
|
13
13
|
|
|
14
14
|
// helper types for recursive readonly.
|
|
@@ -91,7 +91,7 @@ export class OrderedClientCollection
|
|
|
91
91
|
};
|
|
92
92
|
/** Pointer to end of linked list, for optimized client adds. */
|
|
93
93
|
private _youngestClient: LinkNode = this.rootNode;
|
|
94
|
-
private readonly logger:
|
|
94
|
+
private readonly logger: ITelemetryLoggerExt;
|
|
95
95
|
|
|
96
96
|
public get count() {
|
|
97
97
|
return this.clientMap.size;
|
|
@@ -101,7 +101,7 @@ export class OrderedClientCollection
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
constructor(
|
|
104
|
-
logger:
|
|
104
|
+
logger: ITelemetryLoggerExt,
|
|
105
105
|
deltaManager: Pick<IDeltaManager<unknown, unknown>, "lastSequenceNumber">,
|
|
106
106
|
quorum: Pick<IQuorumClients, "getMembers" | "on">,
|
|
107
107
|
) {
|
|
@@ -336,7 +336,7 @@ export class OrderedClientElection
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
constructor(
|
|
339
|
-
private readonly logger:
|
|
339
|
+
private readonly logger: ITelemetryLoggerExt,
|
|
340
340
|
private readonly orderedClientCollection: IOrderedClientCollection,
|
|
341
341
|
/** Serialized state from summary or current sequence number at time of load if new. */
|
|
342
342
|
initialState: ISerializedElection | number,
|
|
@@ -372,7 +372,7 @@ export class OrderedClientElection
|
|
|
372
372
|
// Override the initially elected client with the initial state.
|
|
373
373
|
if (initialClient?.clientId !== initialState.electedClientId) {
|
|
374
374
|
// Cannot find initially elected client, so elect undefined.
|
|
375
|
-
logger.sendErrorEvent({
|
|
375
|
+
this.logger.sendErrorEvent({
|
|
376
376
|
eventName: "InitialElectedClientNotFound",
|
|
377
377
|
electionSequenceNumber: initialState.electionSequenceNumber,
|
|
378
378
|
expectedClientId: initialState.electedClientId,
|
|
@@ -382,7 +382,7 @@ export class OrderedClientElection
|
|
|
382
382
|
} else if (initialClient !== undefined && !isEligibleFn(initialClient)) {
|
|
383
383
|
// Initially elected client is ineligible, so elect next eligible client.
|
|
384
384
|
initialClient = initialParent = this.findFirstEligibleParent(initialParent);
|
|
385
|
-
logger.sendErrorEvent({
|
|
385
|
+
this.logger.sendErrorEvent({
|
|
386
386
|
eventName: "InitialElectedClientIneligible",
|
|
387
387
|
electionSequenceNumber: initialState.electionSequenceNumber,
|
|
388
388
|
expectedClientId: initialState.electedClientId,
|
|
@@ -416,13 +416,6 @@ export class OrderedClientElection
|
|
|
416
416
|
change = true;
|
|
417
417
|
}
|
|
418
418
|
if (change) {
|
|
419
|
-
this.logger.sendTelemetryEvent({
|
|
420
|
-
eventName: "SummarizerClientElected",
|
|
421
|
-
electedClientId: this._electedClient?.clientId,
|
|
422
|
-
electedParentId: this._electedParent?.clientId,
|
|
423
|
-
electionSequenceNumber: sequenceNumber,
|
|
424
|
-
isSummarizerClient,
|
|
425
|
-
});
|
|
426
419
|
this.emit("election", client, sequenceNumber, prevClient);
|
|
427
420
|
}
|
|
428
421
|
}
|
|
@@ -430,12 +423,6 @@ export class OrderedClientElection
|
|
|
430
423
|
private tryElectingParent(client: ILinkedClient | undefined, sequenceNumber: number): void {
|
|
431
424
|
if (this._electedParent !== client) {
|
|
432
425
|
this._electedParent = client;
|
|
433
|
-
this.logger.sendTelemetryEvent({
|
|
434
|
-
eventName: "SummarizerParentElected",
|
|
435
|
-
electedClientId: this._electedClient?.clientId,
|
|
436
|
-
electedParentId: this._electedParent?.clientId,
|
|
437
|
-
electionSequenceNumber: sequenceNumber,
|
|
438
|
-
});
|
|
439
426
|
this.emit("election", this._electedClient, sequenceNumber, this._electedClient);
|
|
440
427
|
}
|
|
441
428
|
}
|
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IDisposable
|
|
7
|
-
import { assert, delay, Deferred, PromiseTimer } from "@fluidframework/common-utils";
|
|
8
|
-
import { UsageError } from "@fluidframework/container-utils";
|
|
9
|
-
import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
10
|
-
import { isRuntimeMessage } from "@fluidframework/driver-utils";
|
|
11
|
-
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
6
|
+
import { IDisposable } from "@fluidframework/common-definitions";
|
|
12
7
|
import {
|
|
8
|
+
ITelemetryLoggerExt,
|
|
13
9
|
ChildLogger,
|
|
14
10
|
isFluidError,
|
|
15
11
|
loggerToMonitoringContext,
|
|
16
12
|
MonitoringContext,
|
|
17
13
|
} from "@fluidframework/telemetry-utils";
|
|
14
|
+
import { assert, delay, Deferred, PromiseTimer } from "@fluidframework/common-utils";
|
|
15
|
+
import { UsageError } from "@fluidframework/container-utils";
|
|
16
|
+
import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
17
|
+
import { isRuntimeMessage } from "@fluidframework/driver-utils";
|
|
18
|
+
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
18
19
|
import { ISummaryConfiguration } from "../containerRuntime";
|
|
19
20
|
import { opSize } from "../opProperties";
|
|
20
21
|
import { SummarizeHeuristicRunner } from "./summarizerHeuristics";
|
|
@@ -56,7 +57,7 @@ const defaultNumberSummarizationAttempts = 2; // only up to 2 attempts
|
|
|
56
57
|
*/
|
|
57
58
|
export class RunningSummarizer implements IDisposable {
|
|
58
59
|
public static async start(
|
|
59
|
-
logger:
|
|
60
|
+
logger: ITelemetryLoggerExt,
|
|
60
61
|
summaryWatcher: IClientSummaryWatcher,
|
|
61
62
|
configuration: ISummaryConfiguration,
|
|
62
63
|
submitSummaryCallback: (options: ISubmitSummaryOptions) => Promise<SubmitSummaryResult>,
|
|
@@ -149,7 +150,7 @@ export class RunningSummarizer implements IDisposable {
|
|
|
149
150
|
private readonly runtimeListener;
|
|
150
151
|
|
|
151
152
|
private constructor(
|
|
152
|
-
baseLogger:
|
|
153
|
+
baseLogger: ITelemetryLoggerExt,
|
|
153
154
|
private readonly summaryWatcher: IClientSummaryWatcher,
|
|
154
155
|
private readonly configuration: ISummaryConfiguration,
|
|
155
156
|
private readonly submitSummaryCallback: (
|
|
@@ -252,7 +253,7 @@ export class RunningSummarizer implements IDisposable {
|
|
|
252
253
|
// Can remove and only listen to runtime once loader version is past 2.0.0-internal.1.2.0 (https://github.com/microsoft/FluidFramework/pull/11832)
|
|
253
254
|
// Tracked by AB#3883
|
|
254
255
|
this.runtime.deltaManager.on("op", this.deltaManagerListener);
|
|
255
|
-
this.runtime.on
|
|
256
|
+
this.runtime.on("op", this.runtimeListener);
|
|
256
257
|
}
|
|
257
258
|
|
|
258
259
|
private async handleSummaryAck(): Promise<number> {
|
|
@@ -347,7 +348,7 @@ export class RunningSummarizer implements IDisposable {
|
|
|
347
348
|
|
|
348
349
|
public dispose(): void {
|
|
349
350
|
this.runtime.deltaManager.off("op", this.deltaManagerListener);
|
|
350
|
-
this.runtime.off
|
|
351
|
+
this.runtime.off("op", this.runtimeListener);
|
|
351
352
|
this.summaryWatcher.dispose();
|
|
352
353
|
this.heuristicRunner?.dispose();
|
|
353
354
|
this.heuristicRunner = undefined;
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
import { EventEmitter } from "events";
|
|
7
7
|
import { Deferred } from "@fluidframework/common-utils";
|
|
8
|
-
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
9
|
-
import { ILoader, LoaderHeader } from "@fluidframework/container-definitions";
|
|
10
|
-
import { UsageError } from "@fluidframework/container-utils";
|
|
11
|
-
import { DriverHeader } from "@fluidframework/driver-definitions";
|
|
12
|
-
import { requestFluidObject } from "@fluidframework/runtime-utils";
|
|
13
8
|
import {
|
|
9
|
+
ITelemetryLoggerExt,
|
|
14
10
|
ChildLogger,
|
|
15
11
|
IFluidErrorBase,
|
|
16
12
|
LoggingError,
|
|
17
13
|
wrapErrorAndLog,
|
|
18
14
|
} from "@fluidframework/telemetry-utils";
|
|
15
|
+
import { ILoader, LoaderHeader } from "@fluidframework/container-definitions";
|
|
16
|
+
import { UsageError } from "@fluidframework/container-utils";
|
|
17
|
+
import { DriverHeader } from "@fluidframework/driver-definitions";
|
|
18
|
+
import { requestFluidObject } from "@fluidframework/runtime-utils";
|
|
19
19
|
import { FluidObject, IFluidHandleContext, IRequest } from "@fluidframework/core-interfaces";
|
|
20
20
|
import { ISummaryConfiguration } from "../containerRuntime";
|
|
21
21
|
import { ICancellableSummarizerController } from "./runWhileConnectedCoordinator";
|
|
@@ -47,7 +47,7 @@ export class SummarizingWarning
|
|
|
47
47
|
super(errorMessage);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
static wrap(error: any, logged: boolean = false, logger:
|
|
50
|
+
static wrap(error: any, logged: boolean = false, logger: ITelemetryLoggerExt) {
|
|
51
51
|
const newErrorFn = (errMsg: string) => new SummarizingWarning(errMsg, logged);
|
|
52
52
|
return wrapErrorAndLog<SummarizingWarning>(error, newErrorFn, logger);
|
|
53
53
|
}
|
|
@@ -66,7 +66,7 @@ export class Summarizer extends EventEmitter implements ISummarizer {
|
|
|
66
66
|
return this;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
private readonly logger:
|
|
69
|
+
private readonly logger: ITelemetryLoggerExt;
|
|
70
70
|
private runningSummarizer?: RunningSummarizer;
|
|
71
71
|
private _disposed: boolean = false;
|
|
72
72
|
private starting: boolean = false;
|
|
@@ -152,7 +152,7 @@ export class Summarizer extends EventEmitter implements ISummarizer {
|
|
|
152
152
|
// This will result in "summarizerClientDisconnected" stop reason recorded in telemetry,
|
|
153
153
|
// unless stop() was called earlier
|
|
154
154
|
this.dispose();
|
|
155
|
-
|
|
155
|
+
this.runtime.disposeFn();
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
private async runCore(onBehalfOf: string): Promise<SummarizerStopReason> {
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IEvent, IEventProvider
|
|
6
|
+
import { IEvent, IEventProvider } from "@fluidframework/common-definitions";
|
|
7
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
7
8
|
import { TypedEventEmitter } from "@fluidframework/common-utils";
|
|
8
9
|
import { IClientDetails, MessageType } from "@fluidframework/protocol-definitions";
|
|
9
10
|
import {
|
|
@@ -55,7 +56,7 @@ export class SummarizerClientElection
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
constructor(
|
|
58
|
-
private readonly logger:
|
|
59
|
+
private readonly logger: ITelemetryLoggerExt,
|
|
59
60
|
private readonly summaryCollection: IEventProvider<ISummaryCollectionOpEvents>,
|
|
60
61
|
public readonly clientElection: IOrderedClientElection,
|
|
61
62
|
private readonly maxOpsSinceLastSummary: number,
|