@fluidframework/container-runtime 2.0.0-internal.5.3.2 → 2.0.0-internal.6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/dist/batchTracker.d.ts +2 -1
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +13 -2
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +103 -25
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +12 -4
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +69 -22
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +344 -238
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +11 -2
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +40 -44
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.js +1 -1
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStores.d.ts +21 -5
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +102 -58
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js +2 -0
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +5 -5
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +29 -25
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.js +13 -11
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +1 -0
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +5 -6
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +4 -6
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +44 -33
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/id-compressor/idCompressor.d.ts +3 -3
- package/dist/id-compressor/idCompressor.d.ts.map +1 -1
- package/dist/id-compressor/idCompressor.js +52 -52
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/idRange.js +2 -2
- package/dist/id-compressor/idRange.js.map +1 -1
- package/dist/id-compressor/sessionIdNormalizer.js +11 -16
- package/dist/id-compressor/sessionIdNormalizer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/batchManager.js +10 -6
- package/dist/opLifecycle/batchManager.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 +7 -2
- 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 +12 -10
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +13 -5
- 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 +11 -7
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +6 -5
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +6 -14
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +6 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +8 -2
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/opProperties.js +1 -2
- package/dist/opProperties.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 +6 -3
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +41 -32
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +15 -11
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +2 -1
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +18 -19
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +3 -5
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +42 -66
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.js +5 -8
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.js +5 -9
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +8 -12
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +5 -5
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +26 -22
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -4
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +4 -3
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +13 -16
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summaryCollection.js +3 -5
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.js +1 -2
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +67 -21
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +2 -3
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +9 -7
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +2 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +2 -2
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +13 -2
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +103 -25
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +13 -5
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +69 -22
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +343 -238
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +11 -2
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +42 -46
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.js +2 -2
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStores.d.ts +21 -5
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +103 -59
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/lib/deltaManagerSummarizerProxy.js +2 -0
- package/lib/deltaManagerSummarizerProxy.js.map +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +6 -6
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +30 -26
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.js +13 -11
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +1 -0
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +5 -6
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +4 -6
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +45 -34
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/id-compressor/idCompressor.d.ts +3 -3
- package/lib/id-compressor/idCompressor.d.ts.map +1 -1
- package/lib/id-compressor/idCompressor.js +52 -52
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/id-compressor/idRange.js +2 -2
- package/lib/id-compressor/idRange.js.map +1 -1
- package/lib/id-compressor/sessionIdNormalizer.js +11 -16
- package/lib/id-compressor/sessionIdNormalizer.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/batchManager.js +10 -6
- package/lib/opLifecycle/batchManager.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 +8 -3
- 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 +13 -11
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +13 -5
- 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 +12 -8
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +6 -5
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +7 -15
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +6 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +8 -2
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/opProperties.js +1 -2
- package/lib/opProperties.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 +6 -3
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +41 -32
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +16 -12
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +2 -1
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +19 -20
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +3 -5
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +43 -67
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.js +6 -9
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.js +5 -9
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +8 -12
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +5 -5
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +27 -23
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -4
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +4 -3
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +14 -17
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summaryCollection.js +3 -5
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.js +1 -2
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +68 -22
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +2 -3
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +10 -8
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +30 -18
- package/src/batchTracker.ts +4 -3
- package/src/blobManager.ts +113 -15
- package/src/connectionTelemetry.ts +7 -3
- package/src/containerRuntime.ts +354 -194
- package/src/dataStore.ts +10 -1
- package/src/dataStoreContext.ts +31 -33
- package/src/dataStoreContexts.ts +2 -2
- package/src/dataStores.ts +108 -71
- package/src/deltaManagerSummarizerProxy.ts +2 -0
- package/src/deltaScheduler.ts +6 -10
- package/src/gc/garbageCollection.ts +13 -8
- package/src/gc/gcHelpers.ts +1 -0
- package/src/gc/gcTelemetry.ts +13 -10
- package/src/id-compressor/idCompressor.ts +6 -5
- package/src/index.ts +0 -1
- package/src/opLifecycle/opCompressor.ts +4 -3
- package/src/opLifecycle/opDecompressor.ts +4 -3
- package/src/opLifecycle/opSplitter.ts +4 -3
- package/src/opLifecycle/outbox.ts +13 -25
- package/src/opLifecycle/remoteMessageProcessor.ts +8 -2
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +34 -25
- package/src/scheduleManager.ts +2 -2
- package/src/summary/orderedClientElection.ts +4 -3
- package/src/summary/runningSummarizer.ts +18 -44
- package/src/summary/summarizer.ts +2 -2
- package/src/summary/summarizerNode/summarizerNode.ts +13 -15
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +8 -7
- package/src/summary/summaryGenerator.ts +6 -2
- package/src/summary/summaryManager.ts +9 -5
package/src/index.ts
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { createChildLogger } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import { assert, IsoBuffer } from "@fluidframework/common-utils";
|
|
8
8
|
import { UsageError } from "@fluidframework/container-utils";
|
|
9
9
|
import { compress } from "lz4js";
|
|
10
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
10
11
|
import { CompressionAlgorithms } from "../containerRuntime";
|
|
11
12
|
import { estimateSocketSize } from "./batchManager";
|
|
12
13
|
import { IBatch, BatchMessage } from "./definitions";
|
|
@@ -19,8 +20,8 @@ import { IBatch, BatchMessage } from "./definitions";
|
|
|
19
20
|
export class OpCompressor {
|
|
20
21
|
private readonly logger;
|
|
21
22
|
|
|
22
|
-
constructor(logger:
|
|
23
|
-
this.logger =
|
|
23
|
+
constructor(logger: ITelemetryBaseLogger) {
|
|
24
|
+
this.logger = createChildLogger({ logger, namespace: "OpCompressor" });
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
public compressBatch(batch: IBatch): IBatch {
|
|
@@ -6,7 +6,8 @@
|
|
|
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 {
|
|
9
|
+
import { createChildLogger } from "@fluidframework/telemetry-utils";
|
|
10
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
10
11
|
import { CompressionAlgorithms } from "../containerRuntime";
|
|
11
12
|
import { IBatchMetadata } from "../metadata";
|
|
12
13
|
import { IMessageProcessingResult } from "./definitions";
|
|
@@ -32,8 +33,8 @@ export class OpDecompressor {
|
|
|
32
33
|
private processedCount = 0;
|
|
33
34
|
private readonly logger;
|
|
34
35
|
|
|
35
|
-
constructor(logger:
|
|
36
|
-
this.logger =
|
|
36
|
+
constructor(logger: ITelemetryBaseLogger) {
|
|
37
|
+
this.logger = createChildLogger({ logger, namespace: "OpDecompressor" });
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
public processMessage(message: ISequencedDocumentMessage): IMessageProcessingResult {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { createChildLogger } from "@fluidframework/telemetry-utils";
|
|
7
7
|
import { assert } from "@fluidframework/common-utils";
|
|
8
8
|
import { IBatchMessage } from "@fluidframework/container-definitions";
|
|
9
9
|
import {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
extractSafePropertiesFromMessage,
|
|
12
12
|
} from "@fluidframework/container-utils";
|
|
13
13
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
14
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
14
15
|
import { ContainerMessageType, ContainerRuntimeMessage } from "../containerRuntime";
|
|
15
16
|
import { estimateSocketSize } from "./batchManager";
|
|
16
17
|
import { BatchMessage, IBatch, IChunkedOp, IMessageProcessingResult } from "./definitions";
|
|
@@ -30,10 +31,10 @@ export class OpSplitter {
|
|
|
30
31
|
| undefined,
|
|
31
32
|
public readonly chunkSizeInBytes: number,
|
|
32
33
|
private readonly maxBatchSizeInBytes: number,
|
|
33
|
-
logger:
|
|
34
|
+
logger: ITelemetryBaseLogger,
|
|
34
35
|
) {
|
|
35
36
|
this.chunkMap = new Map<string, string[]>(chunks);
|
|
36
|
-
this.logger =
|
|
37
|
+
this.logger = createChildLogger({ logger, namespace: "OpSplitter" });
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
public get isBatchChunkingEnabled(): boolean {
|
|
@@ -3,16 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
ITelemetryLoggerExt,
|
|
8
|
-
ChildLogger,
|
|
9
|
-
loggerToMonitoringContext,
|
|
10
|
-
MonitoringContext,
|
|
11
|
-
} from "@fluidframework/telemetry-utils";
|
|
6
|
+
import { createChildMonitoringContext, MonitoringContext } from "@fluidframework/telemetry-utils";
|
|
12
7
|
import { assert } from "@fluidframework/common-utils";
|
|
13
|
-
import {
|
|
8
|
+
import { IBatchMessage, ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
14
9
|
import { GenericError, UsageError } from "@fluidframework/container-utils";
|
|
15
|
-
import {
|
|
10
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
16
11
|
import { ICompressionRuntimeOptions } from "../containerRuntime";
|
|
17
12
|
import { IPendingBatchMessage, PendingStateManager } from "../pendingStateManager";
|
|
18
13
|
import {
|
|
@@ -37,11 +32,14 @@ export interface IOutboxConfig {
|
|
|
37
32
|
export interface IOutboxParameters {
|
|
38
33
|
readonly shouldSend: () => boolean;
|
|
39
34
|
readonly pendingStateManager: PendingStateManager;
|
|
40
|
-
readonly
|
|
35
|
+
readonly submitBatchFn:
|
|
36
|
+
| ((batch: IBatchMessage[], referenceSequenceNumber?: number) => number)
|
|
37
|
+
| undefined;
|
|
38
|
+
readonly legacySendBatchFn: (batch: IBatch) => void;
|
|
41
39
|
readonly config: IOutboxConfig;
|
|
42
40
|
readonly compressor: OpCompressor;
|
|
43
41
|
readonly splitter: OpSplitter;
|
|
44
|
-
readonly logger:
|
|
42
|
+
readonly logger: ITelemetryBaseLogger;
|
|
45
43
|
readonly groupingManager: OpGroupingManager;
|
|
46
44
|
readonly getCurrentSequenceNumbers: () => BatchSequenceNumbers;
|
|
47
45
|
readonly reSubmit: (message: IPendingBatchMessage) => void;
|
|
@@ -100,7 +98,7 @@ export class Outbox {
|
|
|
100
98
|
private mismatchedOpsReported = 0;
|
|
101
99
|
|
|
102
100
|
constructor(private readonly params: IOutboxParameters) {
|
|
103
|
-
this.mc =
|
|
101
|
+
this.mc = createChildMonitoringContext({ logger: params.logger, namespace: "Outbox" });
|
|
104
102
|
const isCompressionEnabled =
|
|
105
103
|
this.params.config.compressionOptions.minimumBatchSizeInBytes !==
|
|
106
104
|
Number.POSITIVE_INFINITY;
|
|
@@ -326,7 +324,7 @@ export class Outbox {
|
|
|
326
324
|
this.params.config.compressionOptions === undefined ||
|
|
327
325
|
this.params.config.compressionOptions.minimumBatchSizeInBytes >
|
|
328
326
|
batch.contentSizeInBytes ||
|
|
329
|
-
this.params.
|
|
327
|
+
this.params.submitBatchFn === undefined
|
|
330
328
|
) {
|
|
331
329
|
// Nothing to do if the batch is empty or if compression is disabled or not supported, or if we don't need to compress
|
|
332
330
|
return disableGroupedBatching ? batch : this.params.groupingManager.groupBatch(batch);
|
|
@@ -381,7 +379,7 @@ export class Outbox {
|
|
|
381
379
|
});
|
|
382
380
|
}
|
|
383
381
|
|
|
384
|
-
if (this.params.
|
|
382
|
+
if (this.params.submitBatchFn === undefined) {
|
|
385
383
|
// Legacy path - supporting old loader versions. Can be removed only when LTS moves above
|
|
386
384
|
// version that has support for batches (submitBatchFn)
|
|
387
385
|
assert(
|
|
@@ -389,23 +387,13 @@ export class Outbox {
|
|
|
389
387
|
0x5a6 /* Compression should not have happened if the loader does not support it */,
|
|
390
388
|
);
|
|
391
389
|
|
|
392
|
-
|
|
393
|
-
this.params.containerContext.submitFn(
|
|
394
|
-
MessageType.Operation,
|
|
395
|
-
// For back-compat (submitFn only works on deserialized content)
|
|
396
|
-
message.contents === undefined ? undefined : JSON.parse(message.contents),
|
|
397
|
-
true, // batch
|
|
398
|
-
message.metadata,
|
|
399
|
-
);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
this.params.containerContext.deltaManager.flush();
|
|
390
|
+
this.params.legacySendBatchFn(batch);
|
|
403
391
|
} else {
|
|
404
392
|
assert(
|
|
405
393
|
batch.referenceSequenceNumber !== undefined,
|
|
406
394
|
0x58e /* Batch must not be empty */,
|
|
407
395
|
);
|
|
408
|
-
this.params.
|
|
396
|
+
this.params.submitBatchFn(
|
|
409
397
|
batch.content.map((message) => ({
|
|
410
398
|
contents: message.contents,
|
|
411
399
|
metadata: message.metadata,
|
|
@@ -24,6 +24,11 @@ export class RemoteMessageProcessor {
|
|
|
24
24
|
this.opSplitter.clearPartialChunks(clientId);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Ungroups and Unchunks the runtime ops encapsulated by the single remoteMessage received over the wire
|
|
29
|
+
* @param remoteMessage - A message from another client, likely a chunked/grouped op
|
|
30
|
+
* @returns the ungrouped, unchunked, unpacked SequencedContainerRuntimeMessage encapsulated in the remote message
|
|
31
|
+
*/
|
|
27
32
|
public process(remoteMessage: ISequencedDocumentMessage): ISequencedDocumentMessage[] {
|
|
28
33
|
const result: ISequencedDocumentMessage[] = [];
|
|
29
34
|
|
|
@@ -32,11 +37,12 @@ export class RemoteMessageProcessor {
|
|
|
32
37
|
const message = this.opDecompressor.processMessage(ungroupedMessage).message;
|
|
33
38
|
|
|
34
39
|
for (let ungroupedMessage2 of this.opGroupingManager.ungroupOp(message)) {
|
|
40
|
+
// unpack and unchunk the ungrouped message in place
|
|
35
41
|
unpackRuntimeMessage(ungroupedMessage2);
|
|
36
|
-
|
|
37
42
|
const chunkProcessingResult =
|
|
38
43
|
this.opSplitter.processRemoteMessage(ungroupedMessage2);
|
|
39
44
|
ungroupedMessage2 = chunkProcessingResult.message;
|
|
45
|
+
|
|
40
46
|
if (chunkProcessingResult.state !== "Processed") {
|
|
41
47
|
// If the message is not chunked or if the splitter is still rebuilding the original message,
|
|
42
48
|
// there is no need to continue processing
|
|
@@ -106,7 +112,7 @@ const unpack = (message: ISequencedDocumentMessage) => {
|
|
|
106
112
|
*
|
|
107
113
|
* @remarks This API makes no promises regarding backward-compatibility. This is internal API.
|
|
108
114
|
* @param message - message (as it observed in storage / service)
|
|
109
|
-
* @returns
|
|
115
|
+
* @returns whether the given message was unpacked
|
|
110
116
|
*
|
|
111
117
|
* @internal
|
|
112
118
|
*/
|
package/src/packageVersion.ts
CHANGED
|
@@ -9,13 +9,14 @@ import { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
|
9
9
|
import { DataProcessingError } from "@fluidframework/container-utils";
|
|
10
10
|
import { Lazy } from "@fluidframework/core-utils";
|
|
11
11
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
12
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
12
13
|
import Deque from "double-ended-queue";
|
|
13
14
|
import { ContainerMessageType } from "./containerRuntime";
|
|
14
15
|
import { pkgVersion } from "./packageVersion";
|
|
15
16
|
import { IBatchMetadata } from "./metadata";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
|
-
* ! TODO: Remove this interface in "2.0.0-internal.7.0.0" once we only read IPendingMessageNew
|
|
19
|
+
* ! TODO: Remove this interface in "2.0.0-internal.7.0.0" once we only read IPendingMessageNew (AB#4763)
|
|
19
20
|
*/
|
|
20
21
|
export interface IPendingMessageOld {
|
|
21
22
|
type: "message";
|
|
@@ -41,7 +42,7 @@ export interface IPendingMessageNew {
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
|
-
* ! TODO: Remove this type in "2.0.0-internal.7.0.0"
|
|
45
|
+
* ! TODO: Remove this type in "2.0.0-internal.7.0.0" (AB#4763)
|
|
45
46
|
*/
|
|
46
47
|
export type IPendingState = IPendingMessageOld | IPendingMessageNew;
|
|
47
48
|
|
|
@@ -65,6 +66,7 @@ export interface IRuntimeStateHandler {
|
|
|
65
66
|
applyStashedOp(content: string): Promise<unknown>;
|
|
66
67
|
reSubmit(message: IPendingBatchMessage): void;
|
|
67
68
|
reSubmitBatch(batch: IPendingBatchMessage[]): void;
|
|
69
|
+
isActiveConnection: () => boolean;
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
/**
|
|
@@ -113,21 +115,18 @@ export class PendingStateManager implements IDisposable {
|
|
|
113
115
|
if (!this.pendingMessages.isEmpty()) {
|
|
114
116
|
return {
|
|
115
117
|
pendingStates: this.pendingMessages.toArray().map((message) => {
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
+
let content = message.content;
|
|
119
|
+
const parsedContent = JSON.parse(content);
|
|
118
120
|
// IdAllocations need their localOpMetadata stashed in the contents
|
|
119
121
|
// of the op to correctly resume the session when processing stashed ops
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
+
if (parsedContent.type === ContainerMessageType.IdAllocation) {
|
|
123
|
+
parsedContent.contents.stashedState = message.localOpMetadata;
|
|
124
|
+
content = JSON.stringify(parsedContent);
|
|
122
125
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// delete localOpMetadata since it may not be serializable
|
|
128
|
-
// and will be regenerated by applyStashedOp()
|
|
129
|
-
localOpMetadata: undefined,
|
|
130
|
-
};
|
|
126
|
+
|
|
127
|
+
// delete localOpMetadata since it may not be serializable
|
|
128
|
+
// and will be regenerated by applyStashedOp()
|
|
129
|
+
return { ...message, content, localOpMetadata: undefined };
|
|
131
130
|
}),
|
|
132
131
|
};
|
|
133
132
|
}
|
|
@@ -136,10 +135,11 @@ export class PendingStateManager implements IDisposable {
|
|
|
136
135
|
constructor(
|
|
137
136
|
private readonly stateHandler: IRuntimeStateHandler,
|
|
138
137
|
initialLocalState: IPendingLocalState | undefined,
|
|
138
|
+
private readonly logger: ITelemetryLoggerExt | undefined,
|
|
139
139
|
) {
|
|
140
140
|
/**
|
|
141
141
|
* Convert old local state format to the new format (IPendingMessageOld to IPendingMessageNew)
|
|
142
|
-
* ! TODO: Remove this conversion in "2.0.0-internal.7.0.0"
|
|
142
|
+
* ! TODO: Remove this conversion in "2.0.0-internal.7.0.0" (AB#4763)
|
|
143
143
|
*/
|
|
144
144
|
if (initialLocalState?.pendingStates) {
|
|
145
145
|
for (const initialState of initialLocalState.pendingStates) {
|
|
@@ -364,18 +364,16 @@ export class PendingStateManager implements IDisposable {
|
|
|
364
364
|
0x174 /* "initial states should be empty before replaying pending" */,
|
|
365
365
|
);
|
|
366
366
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
367
|
+
const initialPendingMessagesCount = this.pendingMessages.length;
|
|
368
|
+
let remainingPendingMessagesCount = this.pendingMessages.length;
|
|
371
369
|
|
|
372
370
|
// Process exactly `pendingMessagesCount` items in the queue as it represents the number of messages that were
|
|
373
371
|
// pending when we connected. This is important because the `reSubmitFn` might add more items in the queue
|
|
374
372
|
// which must not be replayed.
|
|
375
|
-
while (
|
|
373
|
+
while (remainingPendingMessagesCount > 0) {
|
|
376
374
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
377
375
|
let pendingMessage = this.pendingMessages.shift()!;
|
|
378
|
-
|
|
376
|
+
remainingPendingMessagesCount--;
|
|
379
377
|
assert(
|
|
380
378
|
pendingMessage.opMetadata?.batch !== false,
|
|
381
379
|
0x41b /* We cannot process batches in chunks */,
|
|
@@ -388,14 +386,14 @@ export class PendingStateManager implements IDisposable {
|
|
|
388
386
|
*/
|
|
389
387
|
if (pendingMessage.opMetadata?.batch) {
|
|
390
388
|
assert(
|
|
391
|
-
|
|
389
|
+
remainingPendingMessagesCount > 0,
|
|
392
390
|
0x554 /* Last pending message cannot be a batch begin */,
|
|
393
391
|
);
|
|
394
392
|
|
|
395
393
|
const batch: IPendingBatchMessage[] = [];
|
|
396
394
|
|
|
397
395
|
// check is >= because batch end may be last pending message
|
|
398
|
-
while (
|
|
396
|
+
while (remainingPendingMessagesCount >= 0) {
|
|
399
397
|
batch.push({
|
|
400
398
|
content: pendingMessage.content,
|
|
401
399
|
localOpMetadata: pendingMessage.localOpMetadata,
|
|
@@ -405,11 +403,11 @@ export class PendingStateManager implements IDisposable {
|
|
|
405
403
|
if (pendingMessage.opMetadata?.batch === false) {
|
|
406
404
|
break;
|
|
407
405
|
}
|
|
408
|
-
assert(
|
|
406
|
+
assert(remainingPendingMessagesCount > 0, 0x555 /* No batch end found */);
|
|
409
407
|
|
|
410
408
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
411
409
|
pendingMessage = this.pendingMessages.shift()!;
|
|
412
|
-
|
|
410
|
+
remainingPendingMessagesCount--;
|
|
413
411
|
assert(
|
|
414
412
|
pendingMessage.opMetadata?.batch !== true,
|
|
415
413
|
0x556 /* Batch start needs a corresponding batch end */,
|
|
@@ -425,5 +423,16 @@ export class PendingStateManager implements IDisposable {
|
|
|
425
423
|
});
|
|
426
424
|
}
|
|
427
425
|
}
|
|
426
|
+
|
|
427
|
+
// We replayPendingStates on read connections too - we expect these to get nack'd though, and to then reconnect
|
|
428
|
+
// on a write connection and replay again. This filters out the replay that happens on the read connection so
|
|
429
|
+
// we only see the replays on write connections (that have a chance to go through).
|
|
430
|
+
if (this.stateHandler.isActiveConnection()) {
|
|
431
|
+
this.logger?.sendTelemetryEvent({
|
|
432
|
+
eventName: "PendingStatesReplayed",
|
|
433
|
+
count: initialPendingMessagesCount,
|
|
434
|
+
clientId: this.stateHandler.clientId(),
|
|
435
|
+
});
|
|
436
|
+
}
|
|
428
437
|
}
|
|
429
438
|
}
|
package/src/scheduleManager.ts
CHANGED
|
@@ -5,7 +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 { ITelemetryLoggerExt,
|
|
8
|
+
import { ITelemetryLoggerExt, createChildLogger } from "@fluidframework/telemetry-utils";
|
|
9
9
|
import { assert, performance } from "@fluidframework/common-utils";
|
|
10
10
|
import { isRuntimeMessage } from "@fluidframework/driver-utils";
|
|
11
11
|
import {
|
|
@@ -45,7 +45,7 @@ export class ScheduleManager {
|
|
|
45
45
|
) {
|
|
46
46
|
this.deltaScheduler = new DeltaScheduler(
|
|
47
47
|
this.deltaManager,
|
|
48
|
-
|
|
48
|
+
createChildLogger({ logger: this.logger, namespace: "DeltaScheduler" }),
|
|
49
49
|
);
|
|
50
50
|
void new ScheduleManagerCore(deltaManager, getClientId, logger);
|
|
51
51
|
}
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/* eslint-disable @rushstack/no-new-null */
|
|
6
6
|
import { IEvent, IEventProvider } from "@fluidframework/common-definitions";
|
|
7
|
-
import { ITelemetryLoggerExt,
|
|
7
|
+
import { ITelemetryLoggerExt, createChildLogger } from "@fluidframework/telemetry-utils";
|
|
8
8
|
import { assert, TypedEventEmitter } from "@fluidframework/common-utils";
|
|
9
9
|
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
10
10
|
import { UsageError } from "@fluidframework/container-utils";
|
|
11
11
|
import { IClient, IQuorumClients, ISequencedClient } from "@fluidframework/protocol-definitions";
|
|
12
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
12
13
|
import { summarizerClientType } from "./summarizerClientElection";
|
|
13
14
|
|
|
14
15
|
// helper types for recursive readonly.
|
|
@@ -101,12 +102,12 @@ export class OrderedClientCollection
|
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
constructor(
|
|
104
|
-
logger:
|
|
105
|
+
logger: ITelemetryBaseLogger,
|
|
105
106
|
deltaManager: Pick<IDeltaManager<unknown, unknown>, "lastSequenceNumber">,
|
|
106
107
|
quorum: Pick<IQuorumClients, "getMembers" | "on">,
|
|
107
108
|
) {
|
|
108
109
|
super();
|
|
109
|
-
this.logger =
|
|
110
|
+
this.logger = createChildLogger({ logger, namespace: "OrderedClientCollection" });
|
|
110
111
|
const members = quorum.getMembers();
|
|
111
112
|
for (const [clientId, client] of members) {
|
|
112
113
|
this.addClient(clientId, client);
|
|
@@ -3,18 +3,16 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { IDisposable, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
7
|
import {
|
|
8
|
-
ITelemetryLoggerExt,
|
|
9
|
-
ChildLogger,
|
|
10
8
|
isFluidError,
|
|
11
|
-
loggerToMonitoringContext,
|
|
12
9
|
MonitoringContext,
|
|
10
|
+
createChildMonitoringContext,
|
|
11
|
+
createChildLogger,
|
|
13
12
|
} from "@fluidframework/telemetry-utils";
|
|
14
13
|
import { assert, delay, Deferred, PromiseTimer } from "@fluidframework/common-utils";
|
|
15
14
|
import { UsageError } from "@fluidframework/container-utils";
|
|
16
15
|
import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
17
|
-
import { isRuntimeMessage } from "@fluidframework/driver-utils";
|
|
18
16
|
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
19
17
|
import { ISummaryConfiguration } from "../containerRuntime";
|
|
20
18
|
import { opSize } from "../opProperties";
|
|
@@ -57,7 +55,7 @@ const defaultNumberSummarizationAttempts = 2; // only up to 2 attempts
|
|
|
57
55
|
*/
|
|
58
56
|
export class RunningSummarizer implements IDisposable {
|
|
59
57
|
public static async start(
|
|
60
|
-
logger:
|
|
58
|
+
logger: ITelemetryBaseLogger,
|
|
61
59
|
summaryWatcher: IClientSummaryWatcher,
|
|
62
60
|
configuration: ISummaryConfiguration,
|
|
63
61
|
submitSummaryCallback: (options: ISubmitSummaryOptions) => Promise<SubmitSummaryResult>,
|
|
@@ -90,7 +88,10 @@ export class RunningSummarizer implements IDisposable {
|
|
|
90
88
|
// Handle summary acks asynchronously
|
|
91
89
|
// Note: no exceptions are thrown from processIncomingSummaryAcks handler as it handles all exceptions
|
|
92
90
|
summarizer.processIncomingSummaryAcks(lastAckRefSeq).catch((error) => {
|
|
93
|
-
|
|
91
|
+
createChildLogger({ logger }).sendErrorEvent(
|
|
92
|
+
{ eventName: "HandleSummaryAckFatalError" },
|
|
93
|
+
error,
|
|
94
|
+
);
|
|
94
95
|
});
|
|
95
96
|
|
|
96
97
|
// Update heuristic counts
|
|
@@ -146,11 +147,10 @@ export class RunningSummarizer implements IDisposable {
|
|
|
146
147
|
private totalSuccessfulAttempts = 0;
|
|
147
148
|
private initialized = false;
|
|
148
149
|
|
|
149
|
-
private readonly deltaManagerListener;
|
|
150
150
|
private readonly runtimeListener;
|
|
151
151
|
|
|
152
152
|
private constructor(
|
|
153
|
-
baseLogger:
|
|
153
|
+
baseLogger: ITelemetryBaseLogger,
|
|
154
154
|
private readonly summaryWatcher: IClientSummaryWatcher,
|
|
155
155
|
private readonly configuration: ISummaryConfiguration,
|
|
156
156
|
private readonly submitSummaryCallback: (
|
|
@@ -170,11 +170,13 @@ export class RunningSummarizer implements IDisposable {
|
|
|
170
170
|
summarizerSuccessfulAttempts: () => this.totalSuccessfulAttempts,
|
|
171
171
|
};
|
|
172
172
|
|
|
173
|
-
this.mc =
|
|
174
|
-
|
|
173
|
+
this.mc = createChildMonitoringContext({
|
|
174
|
+
logger: baseLogger,
|
|
175
|
+
namespace: "Running",
|
|
176
|
+
properties: {
|
|
175
177
|
all: telemetryProps,
|
|
176
|
-
}
|
|
177
|
-
);
|
|
178
|
+
},
|
|
179
|
+
});
|
|
178
180
|
|
|
179
181
|
if (configuration.state !== "disableHeuristics") {
|
|
180
182
|
assert(
|
|
@@ -235,24 +237,10 @@ export class RunningSummarizer implements IDisposable {
|
|
|
235
237
|
this.mc.logger,
|
|
236
238
|
);
|
|
237
239
|
|
|
238
|
-
// Listen to
|
|
239
|
-
this.
|
|
240
|
-
|
|
241
|
-
this.handleOp(op, false);
|
|
242
|
-
}
|
|
240
|
+
// Listen to runtime for ops
|
|
241
|
+
this.runtimeListener = (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => {
|
|
242
|
+
this.handleOp(op, runtimeMessage === true);
|
|
243
243
|
};
|
|
244
|
-
|
|
245
|
-
// Listen to runtime for runtime ops
|
|
246
|
-
this.runtimeListener = (op, runtimeMessage) => {
|
|
247
|
-
if (runtimeMessage) {
|
|
248
|
-
this.handleOp(op, true);
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
// Purpose of listening to deltaManager is for back-compat
|
|
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)
|
|
254
|
-
// Tracked by AB#3883
|
|
255
|
-
this.runtime.deltaManager.on("op", this.deltaManagerListener);
|
|
256
244
|
this.runtime.on("op", this.runtimeListener);
|
|
257
245
|
}
|
|
258
246
|
|
|
@@ -347,7 +335,6 @@ export class RunningSummarizer implements IDisposable {
|
|
|
347
335
|
}
|
|
348
336
|
|
|
349
337
|
public dispose(): void {
|
|
350
|
-
this.runtime.deltaManager.off("op", this.deltaManagerListener);
|
|
351
338
|
this.runtime.off("op", this.runtimeListener);
|
|
352
339
|
this.summaryWatcher.dispose();
|
|
353
340
|
this.heuristicRunner?.dispose();
|
|
@@ -610,8 +597,6 @@ export class RunningSummarizer implements IDisposable {
|
|
|
610
597
|
throw new UsageError("Invalid number of attempts.");
|
|
611
598
|
}
|
|
612
599
|
|
|
613
|
-
let lastResult: { message: string; error: any } | undefined;
|
|
614
|
-
|
|
615
600
|
for (let summaryAttemptPhase = 0; summaryAttemptPhase < totalAttempts; ) {
|
|
616
601
|
if (this.cancellationToken.cancelled) {
|
|
617
602
|
return;
|
|
@@ -655,7 +640,6 @@ export class RunningSummarizer implements IDisposable {
|
|
|
655
640
|
summaryAttemptPhase++;
|
|
656
641
|
summaryAttemptsPerPhase = 0;
|
|
657
642
|
}
|
|
658
|
-
lastResult = result;
|
|
659
643
|
|
|
660
644
|
const delaySeconds = overrideDelaySeconds ?? regularDelaySeconds;
|
|
661
645
|
|
|
@@ -670,16 +654,6 @@ export class RunningSummarizer implements IDisposable {
|
|
|
670
654
|
}
|
|
671
655
|
}
|
|
672
656
|
|
|
673
|
-
// If all attempts failed, log error (with last attempt info) and close the summarizer container
|
|
674
|
-
this.mc.logger.sendErrorEvent(
|
|
675
|
-
{
|
|
676
|
-
eventName: "FailToSummarize",
|
|
677
|
-
reason,
|
|
678
|
-
message: lastResult?.message,
|
|
679
|
-
},
|
|
680
|
-
lastResult?.error,
|
|
681
|
-
);
|
|
682
|
-
|
|
683
657
|
this.stopSummarizerCallback("failToSummarize");
|
|
684
658
|
},
|
|
685
659
|
() => {
|
|
@@ -7,7 +7,7 @@ import { EventEmitter } from "events";
|
|
|
7
7
|
import { Deferred } from "@fluidframework/common-utils";
|
|
8
8
|
import {
|
|
9
9
|
ITelemetryLoggerExt,
|
|
10
|
-
|
|
10
|
+
createChildLogger,
|
|
11
11
|
IFluidErrorBase,
|
|
12
12
|
LoggingError,
|
|
13
13
|
wrapErrorAndLog,
|
|
@@ -90,7 +90,7 @@ export class Summarizer extends EventEmitter implements ISummarizer {
|
|
|
90
90
|
) => Promise<ICancellableSummarizerController>,
|
|
91
91
|
) {
|
|
92
92
|
super();
|
|
93
|
-
this.logger =
|
|
93
|
+
this.logger = createChildLogger({ logger: this.runtime.logger, namespace: "Summarizer" });
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ITelemetryErrorEvent } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { ITelemetryBaseLogger, ITelemetryErrorEvent } from "@fluidframework/core-interfaces";
|
|
7
7
|
import {
|
|
8
8
|
ISummarizerNode,
|
|
9
9
|
ISummarizerNodeConfig,
|
|
@@ -23,10 +23,11 @@ import {
|
|
|
23
23
|
} from "@fluidframework/protocol-definitions";
|
|
24
24
|
import {
|
|
25
25
|
ITelemetryLoggerExt,
|
|
26
|
-
|
|
26
|
+
createChildLogger,
|
|
27
27
|
LoggingError,
|
|
28
28
|
PerformanceEvent,
|
|
29
29
|
TelemetryDataTag,
|
|
30
|
+
tagCodeArtifacts,
|
|
30
31
|
} from "@fluidframework/telemetry-utils";
|
|
31
32
|
import { assert, unreachableCase } from "@fluidframework/common-utils";
|
|
32
33
|
import {
|
|
@@ -85,30 +86,28 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
85
86
|
* Use createRootSummarizerNode to create root node, or createChild to create child nodes.
|
|
86
87
|
*/
|
|
87
88
|
public constructor(
|
|
88
|
-
baseLogger:
|
|
89
|
+
baseLogger: ITelemetryBaseLogger,
|
|
89
90
|
private readonly summarizeInternalFn: SummarizeInternalFn,
|
|
90
91
|
config: ISummarizerNodeConfig,
|
|
91
92
|
private _changeSequenceNumber: number,
|
|
92
93
|
/** Undefined means created without summary */
|
|
93
94
|
private _latestSummary?: SummaryNode,
|
|
94
95
|
private readonly initialSummary?: IInitialSummary,
|
|
95
|
-
protected wipSummaryLogger?:
|
|
96
|
+
protected wipSummaryLogger?: ITelemetryBaseLogger,
|
|
96
97
|
/** A unique id of this node to be logged when sending telemetry. */
|
|
97
98
|
protected telemetryNodeId?: string,
|
|
98
99
|
) {
|
|
99
100
|
this.canReuseHandle = config.canReuseHandle ?? true;
|
|
100
101
|
// All logs posted by the summarizer node should include the telemetryNodeId.
|
|
101
|
-
this.logger =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
value: this.telemetryNodeId,
|
|
106
|
-
},
|
|
102
|
+
this.logger = createChildLogger({
|
|
103
|
+
logger: baseLogger,
|
|
104
|
+
properties: {
|
|
105
|
+
all: tagCodeArtifacts({ id: this.telemetryNodeId }),
|
|
107
106
|
},
|
|
108
107
|
});
|
|
109
108
|
}
|
|
110
109
|
|
|
111
|
-
public startSummary(referenceSequenceNumber: number, summaryLogger:
|
|
110
|
+
public startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryBaseLogger) {
|
|
112
111
|
assert(
|
|
113
112
|
this.wipSummaryLogger === undefined,
|
|
114
113
|
0x19f /* "wipSummaryLogger should not be set yet in startSummary" */,
|
|
@@ -809,10 +808,9 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
809
808
|
const error = new LoggingError(eventProps.eventName, {
|
|
810
809
|
...eventProps,
|
|
811
810
|
referenceSequenceNumber: this.wipReferenceSequenceNumber,
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
},
|
|
811
|
+
...tagCodeArtifacts({
|
|
812
|
+
id: this.telemetryNodeId,
|
|
813
|
+
}),
|
|
816
814
|
});
|
|
817
815
|
this.logger.sendErrorEvent(eventProps, error);
|
|
818
816
|
throw error;
|