@fluidframework/container-runtime 2.0.0-dev.6.4.0.191515 → 2.0.0-dev.7.2.0.203917
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 +119 -0
- package/api-extractor.json +1 -1
- package/api-report/container-runtime.api.md +864 -0
- package/dist/blobManager.d.ts +4 -4
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +55 -71
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +75 -42
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +1742 -0
- package/dist/container-runtime-beta.d.ts +1742 -0
- package/dist/container-runtime-public.d.ts +1742 -0
- package/dist/container-runtime-untrimmed.d.ts +1803 -0
- package/dist/containerHandleContext.js +3 -3
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +88 -98
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +466 -453
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +11 -11
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +2 -4
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +60 -59
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +3 -0
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +6 -3
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.js +1 -1
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerProxyBase.js +4 -4
- package/dist/deltaManagerProxyBase.js.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js +6 -6
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +23 -24
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.js +1 -1
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +34 -24
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +10 -7
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
- package/dist/gc/gcSummaryDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +2 -2
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +5 -5
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +3 -3
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +1 -1
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +3 -3
- package/dist/gc/index.js.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/identifiers.d.ts +3 -3
- package/dist/id-compressor/identifiers.d.ts.map +1 -1
- package/dist/id-compressor/utilities.d.ts +3 -0
- package/dist/id-compressor/utilities.d.ts.map +1 -1
- package/dist/id-compressor/utilities.js +3 -0
- package/dist/id-compressor/utilities.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +137 -0
- package/dist/messageTypes.d.ts.map +1 -0
- package/dist/messageTypes.js +32 -0
- package/dist/messageTypes.js.map +1 -0
- package/dist/opLifecycle/batchManager.js +6 -6
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +7 -3
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +0 -4
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.js +3 -3
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +7 -2
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +17 -3
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +38 -25
- 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 -20
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +36 -46
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.js +6 -2
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +7 -4
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +54 -54
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +5 -0
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +7 -6
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +40 -38
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +2 -0
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +18 -8
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.js +6 -6
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +9 -9
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +8 -8
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -3
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +107 -22
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +18 -2
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +23 -21
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +15 -6
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +3 -3
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +2 -2
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +10 -10
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/throttler.js +16 -16
- package/dist/throttler.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/blobManager.d.ts +4 -4
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +56 -72
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +76 -43
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.js +3 -3
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +88 -98
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +424 -416
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +11 -11
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +2 -4
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +60 -59
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +3 -0
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js +6 -3
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.js +1 -1
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerProxyBase.js +4 -4
- package/lib/deltaManagerProxyBase.js.map +1 -1
- package/lib/deltaManagerSummarizerProxy.js +6 -6
- package/lib/deltaManagerSummarizerProxy.js.map +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +23 -24
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.js +2 -2
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +34 -24
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +9 -6
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
- package/lib/gc/gcSummaryDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +2 -2
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +5 -5
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +3 -3
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +1 -1
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/id-compressor/identifiers.d.ts +3 -3
- package/lib/id-compressor/identifiers.d.ts.map +1 -1
- package/lib/id-compressor/utilities.d.ts +3 -0
- package/lib/id-compressor/utilities.d.ts.map +1 -1
- package/lib/id-compressor/utilities.js +3 -0
- package/lib/id-compressor/utilities.js.map +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/messageTypes.d.ts +137 -0
- package/lib/messageTypes.d.ts.map +1 -0
- package/lib/messageTypes.js +29 -0
- package/lib/messageTypes.js.map +1 -0
- package/lib/opLifecycle/batchManager.js +6 -6
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +7 -3
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +0 -4
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.js +1 -1
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +7 -2
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +17 -3
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +37 -24
- 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 -20
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +35 -45
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.js +6 -2
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +7 -4
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +54 -54
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +5 -0
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +7 -6
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +40 -38
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +2 -0
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +19 -9
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.js +6 -6
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +9 -9
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +8 -8
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +3 -3
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +107 -22
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +18 -2
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +23 -21
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +15 -6
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +3 -3
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +2 -2
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +9 -9
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/throttler.js +16 -16
- package/lib/throttler.js.map +1 -1
- package/package.json +27 -28
- package/src/blobManager.ts +64 -77
- package/src/connectionTelemetry.ts +97 -52
- package/src/containerRuntime.ts +337 -341
- package/src/dataStore.ts +3 -3
- package/src/dataStoreContext.ts +7 -7
- package/src/dataStoreRegistry.ts +3 -0
- package/src/dataStores.ts +1 -1
- package/src/error.ts +4 -1
- package/src/gc/garbageCollection.ts +12 -11
- package/src/gc/gcConfigs.ts +3 -3
- package/src/gc/gcDefinitions.ts +35 -25
- package/src/gc/gcSummaryDefinitions.ts +1 -1
- package/src/gc/gcTelemetry.ts +6 -5
- package/src/gc/index.ts +2 -2
- package/src/id-compressor/utilities.ts +3 -0
- package/src/index.ts +21 -5
- package/src/messageTypes.ts +228 -0
- package/src/opLifecycle/README.md +93 -68
- package/src/opLifecycle/definitions.ts +5 -1
- package/src/opLifecycle/opDecompressor.ts +0 -8
- package/src/opLifecycle/opGroupingManager.ts +2 -4
- package/src/opLifecycle/opSplitter.ts +2 -2
- package/src/opLifecycle/outbox.ts +3 -0
- package/src/opLifecycle/remoteMessageProcessor.ts +54 -33
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +31 -52
- package/src/scheduleManager.ts +2 -0
- package/src/summary/orderedClientElection.ts +4 -1
- package/src/summary/runWhileConnectedCoordinator.ts +5 -1
- package/src/summary/runningSummarizer.ts +3 -1
- package/src/summary/summarizer.ts +21 -7
- package/src/summary/summarizerNode/summarizerNode.ts +1 -1
- package/src/summary/summarizerTypes.ts +96 -11
- package/src/summary/summaryCollection.ts +19 -1
- package/src/summary/summaryFormat.ts +11 -1
- package/src/summary/summaryGenerator.ts +3 -3
- package/src/summary/summaryManager.ts +2 -2
- package/src/gc/gcEarlyAdoption.md +0 -145
package/src/scheduleManager.ts
CHANGED
|
@@ -271,6 +271,7 @@ class ScheduleManagerCore {
|
|
|
271
271
|
{
|
|
272
272
|
runtimeVersion: pkgVersion,
|
|
273
273
|
batchClientId:
|
|
274
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
274
275
|
this.currentBatchClientId === null ? "null" : this.currentBatchClientId,
|
|
275
276
|
pauseSequenceNumber: this.pauseSequenceNumber,
|
|
276
277
|
localBatch: this.currentBatchClientId === this.getClientId(),
|
|
@@ -306,6 +307,7 @@ class ScheduleManagerCore {
|
|
|
306
307
|
throw new DataCorruptionError("OpBatchIncomplete", {
|
|
307
308
|
runtimeVersion: pkgVersion,
|
|
308
309
|
batchClientId:
|
|
310
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
309
311
|
this.currentBatchClientId === null ? "null" : this.currentBatchClientId,
|
|
310
312
|
pauseSequenceNumber: this.pauseSequenceNumber,
|
|
311
313
|
localBatch: this.currentBatchClientId === this.getClientId(),
|
|
@@ -225,7 +225,10 @@ export interface IOrderedClientElectionEvents extends IEvent {
|
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* Serialized state of IOrderedClientElection.
|
|
230
|
+
* @public
|
|
231
|
+
*/
|
|
229
232
|
export interface ISerializedElection {
|
|
230
233
|
/** Sequence number at the time of the latest election. */
|
|
231
234
|
readonly electionSequenceNumber: number;
|
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
ISummaryCancellationToken,
|
|
11
11
|
} from "./summarizerTypes";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Similar to AbortController, but using promise instead of events
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
14
17
|
export interface ICancellableSummarizerController extends ISummaryCancellationToken {
|
|
15
18
|
stop(reason: SummarizerStopReason): void;
|
|
16
19
|
}
|
|
@@ -18,6 +21,7 @@ export interface ICancellableSummarizerController extends ISummaryCancellationTo
|
|
|
18
21
|
/**
|
|
19
22
|
* Can be useful in testing as well as in places where caller does not use cancellation.
|
|
20
23
|
* This object implements ISummaryCancellationToken interface but cancellation is never leveraged.
|
|
24
|
+
* @public
|
|
21
25
|
*/
|
|
22
26
|
export const neverCancelledSummaryToken: ISummaryCancellationToken = {
|
|
23
27
|
cancelled: false,
|
|
@@ -308,7 +308,8 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
|
|
|
308
308
|
// latest version with which we will refresh the state. However in case of single commit
|
|
309
309
|
// summary, we might me missing a summary ack, so in that case we are still fine as the
|
|
310
310
|
// code in `submitSummary` function in container runtime, will refresh the latest state
|
|
311
|
-
// by calling `
|
|
311
|
+
// by calling `prefetchLatestSummaryThenClose`. We will load the next summarizer from the
|
|
312
|
+
// updated state and be fine.
|
|
312
313
|
const isIgnoredError =
|
|
313
314
|
isFluidError(error) &&
|
|
314
315
|
error.errorType === DriverErrorTypes.fileNotFoundOrAccessDeniedError;
|
|
@@ -407,6 +408,7 @@ export class RunningSummarizer extends TypedEventEmitter<ISummarizerEvents> impl
|
|
|
407
408
|
!this.heuristicRunnerMicroTaskExists
|
|
408
409
|
) {
|
|
409
410
|
this.heuristicRunnerMicroTaskExists = true;
|
|
411
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
410
412
|
Promise.resolve()
|
|
411
413
|
.then(() => {
|
|
412
414
|
this.heuristicRunner?.run();
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
} from "@fluidframework/telemetry-utils";
|
|
16
16
|
import { ILoader, LoaderHeader } from "@fluidframework/container-definitions";
|
|
17
17
|
import { DriverHeader } from "@fluidframework/driver-definitions";
|
|
18
|
-
import { requestFluidObject } from "@fluidframework/runtime-utils";
|
|
19
18
|
import { FluidObject, IFluidHandleContext, IRequest } from "@fluidframework/core-interfaces";
|
|
19
|
+
import { responseToException } from "@fluidframework/runtime-utils";
|
|
20
20
|
import { ISummaryConfiguration } from "../containerRuntime";
|
|
21
21
|
import { ICancellableSummarizerController } from "./runWhileConnectedCoordinator";
|
|
22
22
|
import { summarizerClientType } from "./summarizerClientElection";
|
|
@@ -49,7 +49,10 @@ export class SummarizingWarning
|
|
|
49
49
|
readonly errorType = summarizingError;
|
|
50
50
|
readonly canRetry = true;
|
|
51
51
|
|
|
52
|
-
constructor(
|
|
52
|
+
constructor(
|
|
53
|
+
errorMessage: string,
|
|
54
|
+
readonly logged: boolean = false,
|
|
55
|
+
) {
|
|
53
56
|
super(errorMessage);
|
|
54
57
|
}
|
|
55
58
|
|
|
@@ -66,6 +69,7 @@ export const createSummarizingWarning = (errorMessage: string, logged: boolean)
|
|
|
66
69
|
* Summarizer is responsible for coordinating when to generate and send summaries.
|
|
67
70
|
* It is the main entry point for summary work.
|
|
68
71
|
* It is created only by summarizing container (i.e. one with clientType === "summarizer")
|
|
72
|
+
* @public
|
|
69
73
|
*/
|
|
70
74
|
export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements ISummarizer {
|
|
71
75
|
public get ISummarizer() {
|
|
@@ -107,6 +111,7 @@ export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements
|
|
|
107
111
|
* interface will expect an absolute URL and will not handle "/".
|
|
108
112
|
* @param loader - the loader that resolves the request
|
|
109
113
|
* @param url - the URL used to resolve the container
|
|
114
|
+
* @deprecated Creating a summarizer is not a publicly supported API. Please remove all usage of this static method.
|
|
110
115
|
*/
|
|
111
116
|
public static async create(loader: ILoader, url: string): Promise<ISummarizer> {
|
|
112
117
|
const request: IRequest = {
|
|
@@ -123,11 +128,20 @@ export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements
|
|
|
123
128
|
};
|
|
124
129
|
|
|
125
130
|
const resolvedContainer = await loader.resolve(request);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
let fluidObject: FluidObject<ISummarizer> | undefined;
|
|
132
|
+
|
|
133
|
+
// Older containers may not have the "getEntryPoint" API
|
|
134
|
+
// ! This check will need to stay until LTS of loader moves past 2.0.0-internal.7.0.0
|
|
135
|
+
if (resolvedContainer.getEntryPoint !== undefined) {
|
|
136
|
+
fluidObject = await resolvedContainer.getEntryPoint();
|
|
137
|
+
} else {
|
|
138
|
+
const response = await resolvedContainer.request({ url: "_summarizer" });
|
|
139
|
+
if (response.status !== 200 || response.mimeType !== "fluid/object") {
|
|
140
|
+
throw responseToException(response, request);
|
|
141
|
+
}
|
|
142
|
+
fluidObject = response.value;
|
|
143
|
+
}
|
|
144
|
+
|
|
131
145
|
if (fluidObject?.ISummarizer === undefined) {
|
|
132
146
|
throw new UsageError("Fluid object does not implement ISummarizer");
|
|
133
147
|
}
|
|
@@ -424,7 +424,7 @@ export class SummarizerNode implements IRootSummarizerNode {
|
|
|
424
424
|
* Called when we get an ack from the server for a summary we've just sent. Updates the reference state of this node
|
|
425
425
|
* from the state in the pending summary queue.
|
|
426
426
|
* @param proposalHandle - Handle for the current proposal.
|
|
427
|
-
* @param referenceSequenceNumber -
|
|
427
|
+
* @param referenceSequenceNumber - Reference sequence number of sent summary.
|
|
428
428
|
*/
|
|
429
429
|
protected refreshLatestSummaryFromPending(
|
|
430
430
|
proposalHandle: string,
|
|
@@ -19,6 +19,7 @@ import { SummarizeReason } from "./summaryGenerator";
|
|
|
19
19
|
/**
|
|
20
20
|
* Similar to AbortSignal, but using promise instead of events
|
|
21
21
|
* @param T - cancellation reason type
|
|
22
|
+
* @public
|
|
22
23
|
*/
|
|
23
24
|
export interface ICancellationToken<T> {
|
|
24
25
|
/** Tells if this cancellable token is cancelled */
|
|
@@ -30,11 +31,15 @@ export interface ICancellationToken<T> {
|
|
|
30
31
|
readonly waitCancelled: Promise<T>;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Similar to AbortSignal, but using promise instead of events
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
34
38
|
export type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;
|
|
35
39
|
|
|
36
40
|
/**
|
|
37
41
|
* Data required to update internal tracking state after receiving a Summary Ack.
|
|
42
|
+
* @public
|
|
38
43
|
*/
|
|
39
44
|
export interface IRefreshSummaryAckOptions {
|
|
40
45
|
/** Handle from the ack's summary op. */
|
|
@@ -47,6 +52,9 @@ export interface IRefreshSummaryAckOptions {
|
|
|
47
52
|
readonly summaryLogger: ITelemetryLoggerExt;
|
|
48
53
|
}
|
|
49
54
|
|
|
55
|
+
/**
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
50
58
|
export interface ISummarizerInternalsProvider {
|
|
51
59
|
/** Encapsulates the work to walk the internals of the running container to generate a summary */
|
|
52
60
|
submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
|
|
@@ -57,6 +65,7 @@ export interface ISummarizerInternalsProvider {
|
|
|
57
65
|
|
|
58
66
|
/**
|
|
59
67
|
* @deprecated Options that control the behavior of a running summarizer.
|
|
68
|
+
* @public
|
|
60
69
|
* */
|
|
61
70
|
export interface ISummarizerOptions {
|
|
62
71
|
/**
|
|
@@ -68,11 +77,17 @@ export interface ISummarizerOptions {
|
|
|
68
77
|
disableHeuristics: boolean;
|
|
69
78
|
}
|
|
70
79
|
|
|
80
|
+
/**
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
71
83
|
export interface ISummarizingWarning extends ContainerWarning {
|
|
72
84
|
readonly errorType: "summarizingError";
|
|
73
85
|
readonly logged: boolean;
|
|
74
86
|
}
|
|
75
87
|
|
|
88
|
+
/**
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
76
91
|
export interface IConnectableRuntime {
|
|
77
92
|
readonly disposed: boolean;
|
|
78
93
|
readonly connected: boolean;
|
|
@@ -80,6 +95,9 @@ export interface IConnectableRuntime {
|
|
|
80
95
|
once(event: "connected" | "disconnected" | "dispose", listener: () => void): this;
|
|
81
96
|
}
|
|
82
97
|
|
|
98
|
+
/**
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
83
101
|
export interface ISummarizerRuntime extends IConnectableRuntime {
|
|
84
102
|
readonly logger: ITelemetryLoggerExt;
|
|
85
103
|
/** clientId of parent (non-summarizing) container that owns summarizer container */
|
|
@@ -97,18 +115,25 @@ export interface ISummarizerRuntime extends IConnectableRuntime {
|
|
|
97
115
|
): this;
|
|
98
116
|
}
|
|
99
117
|
|
|
100
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* Options affecting summarize behavior.
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
101
122
|
export interface ISummarizeOptions {
|
|
102
123
|
/** True to generate the full tree with no handle reuse optimizations; defaults to false */
|
|
103
124
|
readonly fullTree?: boolean;
|
|
104
125
|
/**
|
|
105
126
|
* True to ask the server what the latest summary is first; defaults to false
|
|
106
127
|
*
|
|
107
|
-
* @deprecated
|
|
128
|
+
* @deprecated Summarize will not refresh latest snapshot state anymore. Instead it updates the cache and closes.
|
|
129
|
+
* It's expected a new summarizer client will be created, likely by the same parent.
|
|
108
130
|
*/
|
|
109
131
|
readonly refreshLatestAck?: boolean;
|
|
110
132
|
}
|
|
111
133
|
|
|
134
|
+
/**
|
|
135
|
+
* @public
|
|
136
|
+
*/
|
|
112
137
|
export interface ISubmitSummaryOptions extends ISummarizeOptions {
|
|
113
138
|
/** Logger to use for correlated summary events */
|
|
114
139
|
readonly summaryLogger: ITelemetryLoggerExt;
|
|
@@ -118,12 +143,18 @@ export interface ISubmitSummaryOptions extends ISummarizeOptions {
|
|
|
118
143
|
readonly finalAttempt?: boolean;
|
|
119
144
|
}
|
|
120
145
|
|
|
146
|
+
/**
|
|
147
|
+
* @public
|
|
148
|
+
*/
|
|
121
149
|
export interface IOnDemandSummarizeOptions extends ISummarizeOptions {
|
|
122
150
|
/** Reason for generating summary. */
|
|
123
151
|
readonly reason: string;
|
|
124
152
|
}
|
|
125
153
|
|
|
126
|
-
/**
|
|
154
|
+
/**
|
|
155
|
+
* Options to use when enqueueing a summarize attempt.
|
|
156
|
+
* @public
|
|
157
|
+
*/
|
|
127
158
|
export interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
|
|
128
159
|
/** If specified, The summarize attempt will not occur until after this sequence number. */
|
|
129
160
|
readonly afterSequenceNumber?: number;
|
|
@@ -140,6 +171,7 @@ export interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
|
|
|
140
171
|
/**
|
|
141
172
|
* In addition to the normal summary tree + stats, this contains additional stats
|
|
142
173
|
* only relevant at the root of the tree.
|
|
174
|
+
* @public
|
|
143
175
|
*/
|
|
144
176
|
export interface IGeneratedSummaryStats extends ISummaryStats {
|
|
145
177
|
/** The total number of data stores in the container. */
|
|
@@ -156,7 +188,10 @@ export interface IGeneratedSummaryStats extends ISummaryStats {
|
|
|
156
188
|
readonly summaryNumber: number;
|
|
157
189
|
}
|
|
158
190
|
|
|
159
|
-
/**
|
|
191
|
+
/**
|
|
192
|
+
* Base results for all submitSummary attempts.
|
|
193
|
+
* @public
|
|
194
|
+
*/
|
|
160
195
|
export interface IBaseSummarizeResult {
|
|
161
196
|
readonly stage: "base";
|
|
162
197
|
/** Error object related to failed summarize attempt. */
|
|
@@ -166,7 +201,10 @@ export interface IBaseSummarizeResult {
|
|
|
166
201
|
readonly minimumSequenceNumber: number;
|
|
167
202
|
}
|
|
168
203
|
|
|
169
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* Results of submitSummary after generating the summary tree.
|
|
206
|
+
* @public
|
|
207
|
+
*/
|
|
170
208
|
export interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, "stage"> {
|
|
171
209
|
readonly stage: "generate";
|
|
172
210
|
/** Generated summary tree. */
|
|
@@ -179,7 +217,10 @@ export interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, "
|
|
|
179
217
|
readonly forcedFullTree: boolean;
|
|
180
218
|
}
|
|
181
219
|
|
|
182
|
-
/**
|
|
220
|
+
/**
|
|
221
|
+
* Results of submitSummary after uploading the tree to storage.
|
|
222
|
+
* @public
|
|
223
|
+
*/
|
|
183
224
|
export interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, "stage"> {
|
|
184
225
|
readonly stage: "upload";
|
|
185
226
|
/** The handle returned by storage pointing to the uploaded summary tree. */
|
|
@@ -188,7 +229,10 @@ export interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, "
|
|
|
188
229
|
readonly uploadDuration: number;
|
|
189
230
|
}
|
|
190
231
|
|
|
191
|
-
/**
|
|
232
|
+
/**
|
|
233
|
+
* Results of submitSummary after submitting the summarize op.
|
|
234
|
+
* @public
|
|
235
|
+
*/
|
|
192
236
|
export interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, "stage" | "error"> {
|
|
193
237
|
readonly stage: "submit";
|
|
194
238
|
/** The client sequence number of the summarize op submitted for the summary. */
|
|
@@ -212,6 +256,7 @@ export interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, "stag
|
|
|
212
256
|
* 3. "upload" - the summary was uploaded to storage, and the result contains the server-provided handle
|
|
213
257
|
*
|
|
214
258
|
* 4. "submit" - the summarize op was submitted, and the result contains the op client sequence number.
|
|
259
|
+
* @public
|
|
215
260
|
*/
|
|
216
261
|
export type SubmitSummaryResult =
|
|
217
262
|
| IBaseSummarizeResult
|
|
@@ -219,34 +264,55 @@ export type SubmitSummaryResult =
|
|
|
219
264
|
| IUploadSummaryResult
|
|
220
265
|
| ISubmitSummaryOpResult;
|
|
221
266
|
|
|
222
|
-
/**
|
|
267
|
+
/**
|
|
268
|
+
* The stages of Summarize, used to describe how far progress succeeded in case of a failure at a later stage.
|
|
269
|
+
* @public
|
|
270
|
+
*/
|
|
223
271
|
export type SummaryStage = SubmitSummaryResult["stage"] | "unknown";
|
|
224
272
|
|
|
225
|
-
/**
|
|
273
|
+
/**
|
|
274
|
+
* Type for summarization failures that are retriable.
|
|
275
|
+
* @public
|
|
276
|
+
*/
|
|
226
277
|
export interface IRetriableFailureResult {
|
|
227
278
|
readonly retryAfterSeconds?: number;
|
|
228
279
|
}
|
|
229
280
|
|
|
230
|
-
/**
|
|
281
|
+
/**
|
|
282
|
+
* The data in summarizer result when submit summary stage fails.
|
|
283
|
+
* @public
|
|
284
|
+
*/
|
|
231
285
|
export interface SubmitSummaryFailureData extends IRetriableFailureResult {
|
|
232
286
|
stage: SummaryStage;
|
|
233
287
|
}
|
|
234
288
|
|
|
289
|
+
/**
|
|
290
|
+
* @public
|
|
291
|
+
*/
|
|
235
292
|
export interface IBroadcastSummaryResult {
|
|
236
293
|
readonly summarizeOp: ISummaryOpMessage;
|
|
237
294
|
readonly broadcastDuration: number;
|
|
238
295
|
}
|
|
239
296
|
|
|
297
|
+
/**
|
|
298
|
+
* @public
|
|
299
|
+
*/
|
|
240
300
|
export interface IAckSummaryResult {
|
|
241
301
|
readonly summaryAckOp: ISummaryAckMessage;
|
|
242
302
|
readonly ackNackDuration: number;
|
|
243
303
|
}
|
|
244
304
|
|
|
305
|
+
/**
|
|
306
|
+
* @public
|
|
307
|
+
*/
|
|
245
308
|
export interface INackSummaryResult extends IRetriableFailureResult {
|
|
246
309
|
readonly summaryNackOp: ISummaryNackMessage;
|
|
247
310
|
readonly ackNackDuration: number;
|
|
248
311
|
}
|
|
249
312
|
|
|
313
|
+
/**
|
|
314
|
+
* @public
|
|
315
|
+
*/
|
|
250
316
|
export type SummarizeResultPart<TSuccess, TFailure = undefined> =
|
|
251
317
|
| {
|
|
252
318
|
success: true;
|
|
@@ -259,6 +325,9 @@ export type SummarizeResultPart<TSuccess, TFailure = undefined> =
|
|
|
259
325
|
error: any;
|
|
260
326
|
};
|
|
261
327
|
|
|
328
|
+
/**
|
|
329
|
+
* @public
|
|
330
|
+
*/
|
|
262
331
|
export interface ISummarizeResults {
|
|
263
332
|
/** Resolves when we generate, upload, and submit the summary. */
|
|
264
333
|
readonly summarySubmitted: Promise<
|
|
@@ -272,6 +341,9 @@ export interface ISummarizeResults {
|
|
|
272
341
|
>;
|
|
273
342
|
}
|
|
274
343
|
|
|
344
|
+
/**
|
|
345
|
+
* @public
|
|
346
|
+
*/
|
|
275
347
|
export type EnqueueSummarizeResult =
|
|
276
348
|
| (ISummarizeResults & {
|
|
277
349
|
/**
|
|
@@ -299,6 +371,9 @@ export type EnqueueSummarizeResult =
|
|
|
299
371
|
readonly overridden?: undefined;
|
|
300
372
|
};
|
|
301
373
|
|
|
374
|
+
/**
|
|
375
|
+
* @public
|
|
376
|
+
*/
|
|
302
377
|
export type SummarizerStopReason =
|
|
303
378
|
/** Summarizer client failed to summarize in all 3 consecutive attempts. */
|
|
304
379
|
| "failToSummarize"
|
|
@@ -325,16 +400,26 @@ export type SummarizerStopReason =
|
|
|
325
400
|
*/
|
|
326
401
|
| "latestSummaryStateStale";
|
|
327
402
|
|
|
403
|
+
/**
|
|
404
|
+
* @public
|
|
405
|
+
*/
|
|
328
406
|
export interface ISummarizeEventProps {
|
|
329
407
|
result: "success" | "failure" | "canceled";
|
|
330
408
|
currentAttempt: number;
|
|
331
409
|
maxAttempts: number;
|
|
332
410
|
error?: any;
|
|
333
411
|
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* @public
|
|
415
|
+
*/
|
|
334
416
|
export interface ISummarizerEvents extends IEvent {
|
|
335
417
|
(event: "summarize", listener: (props: ISummarizeEventProps) => void);
|
|
336
418
|
}
|
|
337
419
|
|
|
420
|
+
/**
|
|
421
|
+
* @public
|
|
422
|
+
*/
|
|
338
423
|
export interface ISummarizer extends IEventProvider<ISummarizerEvents> {
|
|
339
424
|
/**
|
|
340
425
|
* Allows {@link ISummarizer} to be used with our {@link @fluidframework/core-interfaces#FluidObject} pattern.
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Interface for summary op messages with typed contents.
|
|
22
|
+
* @public
|
|
22
23
|
*/
|
|
23
24
|
export interface ISummaryOpMessage extends ISequencedDocumentMessage {
|
|
24
25
|
type: MessageType.Summarize;
|
|
@@ -27,6 +28,7 @@ export interface ISummaryOpMessage extends ISequencedDocumentMessage {
|
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Interface for summary ack messages with typed contents.
|
|
31
|
+
* @public
|
|
30
32
|
*/
|
|
31
33
|
export interface ISummaryAckMessage extends ISequencedDocumentMessage {
|
|
32
34
|
type: MessageType.SummaryAck;
|
|
@@ -35,6 +37,7 @@ export interface ISummaryAckMessage extends ISequencedDocumentMessage {
|
|
|
35
37
|
|
|
36
38
|
/**
|
|
37
39
|
* Interface for summary nack messages with typed contents.
|
|
40
|
+
* @public
|
|
38
41
|
*/
|
|
39
42
|
export interface ISummaryNackMessage extends ISequencedDocumentMessage {
|
|
40
43
|
type: MessageType.SummaryNack;
|
|
@@ -44,6 +47,7 @@ export interface ISummaryNackMessage extends ISequencedDocumentMessage {
|
|
|
44
47
|
/**
|
|
45
48
|
* A single summary which can be tracked as it goes through its life cycle.
|
|
46
49
|
* The life cycle is: Local to Broadcast to Acked/Nacked.
|
|
50
|
+
* @public
|
|
47
51
|
*/
|
|
48
52
|
export interface ISummary {
|
|
49
53
|
readonly clientId: string;
|
|
@@ -54,6 +58,7 @@ export interface ISummary {
|
|
|
54
58
|
|
|
55
59
|
/**
|
|
56
60
|
* A single summary which has already been acked by the server.
|
|
61
|
+
* @public
|
|
57
62
|
*/
|
|
58
63
|
export interface IAckedSummary {
|
|
59
64
|
readonly summaryOp: ISummaryOpMessage;
|
|
@@ -140,6 +145,7 @@ class Summary implements ISummary {
|
|
|
140
145
|
|
|
141
146
|
/**
|
|
142
147
|
* Watches summaries created by a specific client.
|
|
148
|
+
* @public
|
|
143
149
|
*/
|
|
144
150
|
export interface IClientSummaryWatcher extends IDisposable {
|
|
145
151
|
watchSummary(clientSequenceNumber: number): ISummary;
|
|
@@ -207,13 +213,23 @@ class ClientSummaryWatcher implements IClientSummaryWatcher {
|
|
|
207
213
|
this._disposed = true;
|
|
208
214
|
}
|
|
209
215
|
}
|
|
210
|
-
|
|
216
|
+
/**
|
|
217
|
+
* @public
|
|
218
|
+
*/
|
|
211
219
|
export type OpActionEventName =
|
|
212
220
|
| MessageType.Summarize
|
|
213
221
|
| MessageType.SummaryAck
|
|
214
222
|
| MessageType.SummaryNack
|
|
215
223
|
| "default";
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @public
|
|
227
|
+
*/
|
|
216
228
|
export type OpActionEventListener = (op: ISequencedDocumentMessage) => void;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* @public
|
|
232
|
+
*/
|
|
217
233
|
export interface ISummaryCollectionOpEvents extends IEvent {
|
|
218
234
|
(event: OpActionEventName, listener: OpActionEventListener);
|
|
219
235
|
}
|
|
@@ -222,6 +238,7 @@ export interface ISummaryCollectionOpEvents extends IEvent {
|
|
|
222
238
|
* Data structure that looks at the op stream to track summaries as they
|
|
223
239
|
* are broadcast, acked and nacked.
|
|
224
240
|
* It provides functionality for watching specific summaries.
|
|
241
|
+
* @public
|
|
225
242
|
*/
|
|
226
243
|
export class SummaryCollection extends TypedEventEmitter<ISummaryCollectionOpEvents> {
|
|
227
244
|
// key: clientId
|
|
@@ -405,6 +422,7 @@ export class SummaryCollection extends TypedEventEmitter<ISummaryCollectionOpEve
|
|
|
405
422
|
private handleSummaryAck(op: ISummaryAckMessage) {
|
|
406
423
|
const seq = op.contents.summaryProposal.summarySequenceNumber;
|
|
407
424
|
const summary = this.pendingSummaries.get(seq);
|
|
425
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- optional chain is not logically equivalent
|
|
408
426
|
if (!summary || summary.summaryOp === undefined) {
|
|
409
427
|
// Summary ack without an op should be rare. We could fetch the
|
|
410
428
|
// reference sequence number from the snapshot, but instead we
|
|
@@ -84,6 +84,10 @@ export function getAttributesFormatVersion(attributes: ReadFluidDataStoreAttribu
|
|
|
84
84
|
export function hasIsolatedChannels(attributes: ReadFluidDataStoreAttributes): boolean {
|
|
85
85
|
return !!attributes.summaryFormatVersion && !attributes.disableIsolatedChannels;
|
|
86
86
|
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
87
91
|
export interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {
|
|
88
92
|
readonly summaryFormatVersion: 1;
|
|
89
93
|
/** The last message processed at the time of summary. Only primitive property types are added to the summary. */
|
|
@@ -98,6 +102,9 @@ export interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGC
|
|
|
98
102
|
readonly idCompressorEnabled?: boolean;
|
|
99
103
|
}
|
|
100
104
|
|
|
105
|
+
/**
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
101
108
|
export interface ICreateContainerMetadata {
|
|
102
109
|
/** Runtime version of the container when it was first created */
|
|
103
110
|
createContainerRuntimeVersion?: string;
|
|
@@ -105,7 +112,10 @@ export interface ICreateContainerMetadata {
|
|
|
105
112
|
createContainerTimestamp?: number;
|
|
106
113
|
}
|
|
107
114
|
|
|
108
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* The properties of an ISequencedDocumentMessage to be stored in the metadata blob in summary.
|
|
117
|
+
* @public
|
|
118
|
+
*/
|
|
109
119
|
export type ISummaryMetadataMessage = Pick<
|
|
110
120
|
ISequencedDocumentMessage,
|
|
111
121
|
| "clientId"
|
|
@@ -47,12 +47,12 @@ export async function raceTimer<T>(
|
|
|
47
47
|
cancellationToken?: ISummaryCancellationToken,
|
|
48
48
|
): Promise<raceTimerResult<T>> {
|
|
49
49
|
const promises: Promise<raceTimerResult<T>>[] = [
|
|
50
|
-
promise.then((value) => ({ result: "done", value } as const)
|
|
51
|
-
timer.then(({ timerResult: result }) => ({ result } as const)
|
|
50
|
+
promise.then((value) => ({ result: "done", value }) as const),
|
|
51
|
+
timer.then(({ timerResult: result }) => ({ result }) as const),
|
|
52
52
|
];
|
|
53
53
|
if (cancellationToken !== undefined) {
|
|
54
54
|
promises.push(
|
|
55
|
-
cancellationToken.waitCancelled.then(() => ({ result: "cancelled" } as const)
|
|
55
|
+
cancellationToken.waitCancelled.then(() => ({ result: "cancelled" }) as const),
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
return Promise.race(promises);
|
|
@@ -114,7 +114,7 @@ export class SummaryManager extends TypedEventEmitter<ISummarizerEvents> impleme
|
|
|
114
114
|
parentLogger: ITelemetryBaseLogger,
|
|
115
115
|
/** Creates summarizer by asking interactive container to spawn summarizing container and
|
|
116
116
|
* get back its Summarizer instance. */
|
|
117
|
-
private readonly
|
|
117
|
+
private readonly createSummarizerFn: () => Promise<ISummarizer>,
|
|
118
118
|
private readonly startThrottler: IThrottler,
|
|
119
119
|
{
|
|
120
120
|
initialDelayMs = defaultInitialDelayMs,
|
|
@@ -264,7 +264,7 @@ export class SummaryManager extends TypedEventEmitter<ISummarizerEvents> impleme
|
|
|
264
264
|
);
|
|
265
265
|
this.state = SummaryManagerState.Running;
|
|
266
266
|
|
|
267
|
-
const summarizer = await this.
|
|
267
|
+
const summarizer = await this.createSummarizerFn();
|
|
268
268
|
this.summarizer = summarizer;
|
|
269
269
|
this.summarizer.on("summarize", this.handleSummarizeEvent);
|
|
270
270
|
|