@fluidframework/container-runtime 2.0.0-internal.5.3.1 → 2.0.0-internal.5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- 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 +9 -1
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +55 -12
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +2 -2
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +43 -11
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +189 -137
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +3 -0
- 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 +24 -27
- 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 +1 -1
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +14 -24
- 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 +12 -5
- package/dist/gc/garbageCollection.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 +1 -0
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +15 -22
- 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 +3 -1
- package/dist/id-compressor/idCompressor.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 +1 -1
- 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 +1 -1
- package/dist/opLifecycle/opDecompressor.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 +1 -1
- 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 +5 -12
- 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 +7 -1
- package/dist/opLifecycle/remoteMessageProcessor.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 +4 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +21 -12
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +1 -1
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +1 -1
- 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 +10 -28
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.js +1 -1
- package/dist/summary/summarizer.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 +7 -10
- package/dist/summary/summarizerNode/summarizerNode.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 +4 -8
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +5 -1
- 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 +6 -2
- package/dist/summary/summaryManager.js.map +1 -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 +9 -1
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +55 -12
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +3 -3
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +43 -11
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +188 -137
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +3 -0
- 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 +26 -29
- 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 +1 -1
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +15 -25
- 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 +13 -6
- package/lib/gc/garbageCollection.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 +1 -0
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +16 -23
- 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 +3 -1
- package/lib/id-compressor/idCompressor.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 +2 -2
- 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 +2 -2
- package/lib/opLifecycle/opDecompressor.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 +2 -2
- 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 +6 -13
- 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 +7 -1
- package/lib/opLifecycle/remoteMessageProcessor.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 +4 -1
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +21 -12
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +2 -2
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +2 -2
- 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 +11 -29
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.js +2 -2
- package/lib/summary/summarizer.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 +8 -11
- package/lib/summary/summarizerNode/summarizerNode.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 +5 -9
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +6 -2
- 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 +7 -3
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +16 -16
- package/src/batchTracker.ts +2 -2
- package/src/blobManager.ts +70 -13
- package/src/connectionTelemetry.ts +7 -3
- package/src/containerRuntime.ts +287 -150
- package/src/dataStore.ts +3 -0
- package/src/dataStoreContext.ts +31 -33
- package/src/dataStoreContexts.ts +2 -2
- package/src/dataStores.ts +15 -18
- 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 +12 -8
- package/src/id-compressor/idCompressor.ts +6 -5
- 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 +22 -10
- package/src/scheduleManager.ts +2 -2
- package/src/summary/orderedClientElection.ts +2 -2
- 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
|
@@ -9,6 +9,7 @@ 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";
|
|
@@ -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
|
/**
|
|
@@ -136,6 +138,7 @@ export class PendingStateManager implements IDisposable {
|
|
|
136
138
|
constructor(
|
|
137
139
|
private readonly stateHandler: IRuntimeStateHandler,
|
|
138
140
|
initialLocalState: IPendingLocalState | undefined,
|
|
141
|
+
private readonly logger: ITelemetryLoggerExt | undefined,
|
|
139
142
|
) {
|
|
140
143
|
/**
|
|
141
144
|
* Convert old local state format to the new format (IPendingMessageOld to IPendingMessageNew)
|
|
@@ -364,18 +367,16 @@ export class PendingStateManager implements IDisposable {
|
|
|
364
367
|
0x174 /* "initial states should be empty before replaying pending" */,
|
|
365
368
|
);
|
|
366
369
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
370
|
+
const initialPendingMessagesCount = this.pendingMessages.length;
|
|
371
|
+
let remainingPendingMessagesCount = this.pendingMessages.length;
|
|
371
372
|
|
|
372
373
|
// Process exactly `pendingMessagesCount` items in the queue as it represents the number of messages that were
|
|
373
374
|
// pending when we connected. This is important because the `reSubmitFn` might add more items in the queue
|
|
374
375
|
// which must not be replayed.
|
|
375
|
-
while (
|
|
376
|
+
while (remainingPendingMessagesCount > 0) {
|
|
376
377
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
377
378
|
let pendingMessage = this.pendingMessages.shift()!;
|
|
378
|
-
|
|
379
|
+
remainingPendingMessagesCount--;
|
|
379
380
|
assert(
|
|
380
381
|
pendingMessage.opMetadata?.batch !== false,
|
|
381
382
|
0x41b /* We cannot process batches in chunks */,
|
|
@@ -388,14 +389,14 @@ export class PendingStateManager implements IDisposable {
|
|
|
388
389
|
*/
|
|
389
390
|
if (pendingMessage.opMetadata?.batch) {
|
|
390
391
|
assert(
|
|
391
|
-
|
|
392
|
+
remainingPendingMessagesCount > 0,
|
|
392
393
|
0x554 /* Last pending message cannot be a batch begin */,
|
|
393
394
|
);
|
|
394
395
|
|
|
395
396
|
const batch: IPendingBatchMessage[] = [];
|
|
396
397
|
|
|
397
398
|
// check is >= because batch end may be last pending message
|
|
398
|
-
while (
|
|
399
|
+
while (remainingPendingMessagesCount >= 0) {
|
|
399
400
|
batch.push({
|
|
400
401
|
content: pendingMessage.content,
|
|
401
402
|
localOpMetadata: pendingMessage.localOpMetadata,
|
|
@@ -405,11 +406,11 @@ export class PendingStateManager implements IDisposable {
|
|
|
405
406
|
if (pendingMessage.opMetadata?.batch === false) {
|
|
406
407
|
break;
|
|
407
408
|
}
|
|
408
|
-
assert(
|
|
409
|
+
assert(remainingPendingMessagesCount > 0, 0x555 /* No batch end found */);
|
|
409
410
|
|
|
410
411
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
411
412
|
pendingMessage = this.pendingMessages.shift()!;
|
|
412
|
-
|
|
413
|
+
remainingPendingMessagesCount--;
|
|
413
414
|
assert(
|
|
414
415
|
pendingMessage.opMetadata?.batch !== true,
|
|
415
416
|
0x556 /* Batch start needs a corresponding batch end */,
|
|
@@ -425,5 +426,16 @@ export class PendingStateManager implements IDisposable {
|
|
|
425
426
|
});
|
|
426
427
|
}
|
|
427
428
|
}
|
|
429
|
+
|
|
430
|
+
// We replayPendingStates on read connections too - we expect these to get nack'd though, and to then reconnect
|
|
431
|
+
// on a write connection and replay again. This filters out the replay that happens on the read connection so
|
|
432
|
+
// we only see the replays on write connections (that have a chance to go through).
|
|
433
|
+
if (this.stateHandler.isActiveConnection()) {
|
|
434
|
+
this.logger?.sendTelemetryEvent({
|
|
435
|
+
eventName: "PendingStatesReplayed",
|
|
436
|
+
count: initialPendingMessagesCount,
|
|
437
|
+
clientId: this.stateHandler.clientId(),
|
|
438
|
+
});
|
|
439
|
+
}
|
|
428
440
|
}
|
|
429
441
|
}
|
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,7 +4,7 @@
|
|
|
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";
|
|
@@ -106,7 +106,7 @@ export class OrderedClientCollection
|
|
|
106
106
|
quorum: Pick<IQuorumClients, "getMembers" | "on">,
|
|
107
107
|
) {
|
|
108
108
|
super();
|
|
109
|
-
this.logger =
|
|
109
|
+
this.logger = createChildLogger({ logger, namespace: "OrderedClientCollection" });
|
|
110
110
|
const members = quorum.getMembers();
|
|
111
111
|
for (const [clientId, client] of members) {
|
|
112
112
|
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;
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ITelemetryLoggerExt,
|
|
8
8
|
LoggingError,
|
|
9
9
|
TelemetryDataTag,
|
|
10
|
+
tagCodeArtifacts,
|
|
10
11
|
} from "@fluidframework/telemetry-utils";
|
|
11
12
|
import { assert } from "@fluidframework/common-utils";
|
|
12
13
|
import { LazyPromise } from "@fluidframework/core-utils";
|
|
@@ -25,6 +26,7 @@ import {
|
|
|
25
26
|
IExperimentalIncrementalSummaryContext,
|
|
26
27
|
} from "@fluidframework/runtime-definitions";
|
|
27
28
|
import { ReadAndParseBlob, unpackChildNodesUsedRoutes } from "@fluidframework/runtime-utils";
|
|
29
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
28
30
|
import {
|
|
29
31
|
cloneGCData,
|
|
30
32
|
getGCDataFromSnapshot,
|
|
@@ -107,7 +109,7 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
107
109
|
* Use createRootSummarizerNodeWithGC to create root node, or createChild to create child nodes.
|
|
108
110
|
*/
|
|
109
111
|
public constructor(
|
|
110
|
-
logger:
|
|
112
|
+
logger: ITelemetryBaseLogger,
|
|
111
113
|
private readonly summarizeFn: (
|
|
112
114
|
fullTree: boolean,
|
|
113
115
|
trackState: boolean,
|
|
@@ -119,7 +121,7 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
119
121
|
/** Undefined means created without summary */
|
|
120
122
|
latestSummary?: SummaryNode,
|
|
121
123
|
initialSummary?: IInitialSummary,
|
|
122
|
-
wipSummaryLogger?:
|
|
124
|
+
wipSummaryLogger?: ITelemetryBaseLogger,
|
|
123
125
|
private readonly getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
|
|
124
126
|
getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,
|
|
125
127
|
/** A unique id of this node to be logged when sending telemetry. */
|
|
@@ -370,10 +372,9 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
370
372
|
const error = new LoggingError("MissingGCStateInPendingSummary", {
|
|
371
373
|
proposalHandle,
|
|
372
374
|
referenceSequenceNumber,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
},
|
|
375
|
+
...tagCodeArtifacts({
|
|
376
|
+
id: this.telemetryNodeId,
|
|
377
|
+
}),
|
|
377
378
|
});
|
|
378
379
|
this.logger.sendErrorEvent(
|
|
379
380
|
{
|
|
@@ -666,7 +667,7 @@ export class SummarizerNodeWithGC extends SummarizerNode implements IRootSummari
|
|
|
666
667
|
* @param baseGCDetailsP - Function to get the initial GC details of this node
|
|
667
668
|
*/
|
|
668
669
|
export const createRootSummarizerNodeWithGC = (
|
|
669
|
-
logger:
|
|
670
|
+
logger: ITelemetryBaseLogger,
|
|
670
671
|
summarizeInternalFn: SummarizeInternalFn,
|
|
671
672
|
changeSequenceNumber: number,
|
|
672
673
|
referenceSequenceNumber: number | undefined,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
ITelemetryLoggerExt,
|
|
8
8
|
PerformanceEvent,
|
|
9
9
|
LoggingError,
|
|
10
|
-
|
|
10
|
+
createChildLogger,
|
|
11
11
|
} from "@fluidframework/telemetry-utils";
|
|
12
12
|
import { ITelemetryProperties } from "@fluidframework/core-interfaces";
|
|
13
13
|
|
|
@@ -240,7 +240,11 @@ export class SummaryGenerator {
|
|
|
240
240
|
cancellationToken: ISummaryCancellationToken,
|
|
241
241
|
): Promise<void> {
|
|
242
242
|
const { refreshLatestAck, fullTree } = options;
|
|
243
|
-
const logger =
|
|
243
|
+
const logger = createChildLogger({
|
|
244
|
+
logger: this.logger,
|
|
245
|
+
namespace: undefined,
|
|
246
|
+
properties: { all: summarizeProps },
|
|
247
|
+
});
|
|
244
248
|
|
|
245
249
|
// Note: timeSinceLastAttempt and timeSinceLastSummary for the
|
|
246
250
|
// first summary are basically the time since the summarizer was loaded.
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { IEvent, IEventProvider } from "@fluidframework/common-definitions";
|
|
7
|
-
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
7
|
+
import { IDisposable, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { assert } from "@fluidframework/common-utils";
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
createChildLogger,
|
|
11
11
|
ITelemetryLoggerExt,
|
|
12
12
|
PerformanceEvent,
|
|
13
13
|
} from "@fluidframework/telemetry-utils";
|
|
@@ -97,7 +97,7 @@ export class SummaryManager implements IDisposable {
|
|
|
97
97
|
SummaryCollection,
|
|
98
98
|
"opsSinceLastAck" | "addOpListener" | "removeOpListener"
|
|
99
99
|
>,
|
|
100
|
-
parentLogger:
|
|
100
|
+
parentLogger: ITelemetryBaseLogger,
|
|
101
101
|
/** Creates summarizer by asking interactive container to spawn summarizing container and
|
|
102
102
|
* get back its Summarizer instance. */
|
|
103
103
|
private readonly requestSummarizerFn: () => Promise<ISummarizer>,
|
|
@@ -108,8 +108,12 @@ export class SummaryManager implements IDisposable {
|
|
|
108
108
|
}: Readonly<Partial<ISummaryManagerConfig>> = {},
|
|
109
109
|
private readonly disableHeuristics?: boolean,
|
|
110
110
|
) {
|
|
111
|
-
this.logger =
|
|
112
|
-
|
|
111
|
+
this.logger = createChildLogger({
|
|
112
|
+
logger: parentLogger,
|
|
113
|
+
namespace: "SummaryManager",
|
|
114
|
+
properties: {
|
|
115
|
+
all: { clientId: () => this.latestClientId },
|
|
116
|
+
},
|
|
113
117
|
});
|
|
114
118
|
|
|
115
119
|
this.connectedState.on("connected", this.handleConnected);
|