@fluidframework/container-runtime 2.117.0 → 3.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 +70 -2
- package/README.md +53 -50
- package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
- package/api-report/container-runtime.legacy.alpha.api.md +3 -1
- package/api-report/container-runtime.legacy.beta.api.md +3 -1
- package/container-runtime.test-files.tar +0 -0
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +5 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager/blobManager.d.ts +1 -1
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +264 -231
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +70 -58
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.js +38 -20
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerCompatibility.d.ts +3 -3
- package/dist/containerCompatibility.d.ts.map +1 -1
- package/dist/containerCompatibility.js +36 -45
- package/dist/containerCompatibility.js.map +1 -1
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js +4 -0
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +4 -4
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +346 -223
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +9 -1
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +184 -127
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.js +43 -42
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.js +1 -0
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/deltaManagerProxies.js +5 -0
- package/dist/deltaManagerProxies.js.map +1 -1
- package/dist/deltaScheduler.js +104 -99
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.js +2 -1
- package/dist/error.js.map +1 -1
- package/dist/gc/garbageCollection.js +85 -55
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.js +2 -3
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcHelpers.js +12 -13
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.js +1 -2
- package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +8 -3
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.js +12 -5
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +18 -1
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/inboundBatchAggregator.js +122 -117
- package/dist/inboundBatchAggregator.js.map +1 -1
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +3 -3
- package/dist/metadata.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +11 -5
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/duplicateBatchDetector.js +18 -18
- package/dist/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +2 -2
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +2 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.js +2 -1
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +10 -6
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +5 -3
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSerialization.d.ts +11 -1
- package/dist/opLifecycle/opSerialization.d.ts.map +1 -1
- package/dist/opLifecycle/opSerialization.js +22 -6
- package/dist/opLifecycle/opSerialization.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +17 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +46 -9
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +17 -13
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +6 -3
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/opProperties.d.ts.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.js +54 -47
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/runCounter.js +10 -30
- package/dist/runCounter.js.map +1 -1
- package/dist/runtimeLayerCompatState.d.ts +1 -1
- package/dist/runtimeLayerCompatState.d.ts.map +1 -1
- package/dist/runtimeLayerCompatState.js +31 -11
- package/dist/runtimeLayerCompatState.js.map +1 -1
- package/dist/signalTelemetryProcessing.js +15 -17
- package/dist/signalTelemetryProcessing.js.map +1 -1
- package/dist/storageServiceWithAttachBlobs.js +2 -0
- package/dist/storageServiceWithAttachBlobs.js.map +1 -1
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +51 -13
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/orderedClientElection.js +25 -17
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js +18 -7
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +22 -13
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +20 -6
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerUtils.d.ts.map +1 -1
- package/dist/summary/summarizerUtils.js +4 -3
- package/dist/summary/summarizerUtils.js.map +1 -1
- package/dist/summary/summaryCollection.js +23 -11
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.js +4 -2
- package/dist/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js +65 -46
- package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summarizer.js +15 -6
- package/dist/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summarizerHeuristics.js +30 -25
- package/dist/summary/summaryDelayLoadedModule/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js +9 -0
- package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryDelayLoadedModule/summaryResultBuilder.js +3 -5
- package/dist/summary/summaryDelayLoadedModule/summaryResultBuilder.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +7 -7
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryHelpers.js +5 -5
- package/dist/summary/summaryHelpers.js.map +1 -1
- package/dist/summary/summaryManager.js +66 -54
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/throttler.d.ts.map +1 -1
- package/dist/throttler.js +4 -1
- package/dist/throttler.js.map +1 -1
- package/dist/versionMarks/inboundBatch.d.ts +8 -6
- package/dist/versionMarks/inboundBatch.d.ts.map +1 -1
- package/dist/versionMarks/inboundBatch.js +11 -7
- package/dist/versionMarks/inboundBatch.js.map +1 -1
- package/dist/versionMarks/versionMarkResolver.d.ts +30 -23
- package/dist/versionMarks/versionMarkResolver.d.ts.map +1 -1
- package/dist/versionMarks/versionMarkResolver.js +112 -63
- package/dist/versionMarks/versionMarkResolver.js.map +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +5 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts +1 -1
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +264 -231
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +65 -53
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.js +36 -18
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerCompatibility.d.ts +3 -3
- package/lib/containerCompatibility.d.ts.map +1 -1
- package/lib/containerCompatibility.js +33 -42
- package/lib/containerCompatibility.js.map +1 -1
- package/lib/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js +4 -0
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +4 -4
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +341 -218
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +9 -1
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +182 -125
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.js +43 -42
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.js +1 -0
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/deltaManagerProxies.js +5 -0
- package/lib/deltaManagerProxies.js.map +1 -1
- package/lib/deltaScheduler.js +104 -99
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.js +2 -1
- package/lib/error.js.map +1 -1
- package/lib/gc/garbageCollection.js +85 -55
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +8 -3
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.js +12 -5
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +18 -1
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/inboundBatchAggregator.js +122 -117
- package/lib/inboundBatchAggregator.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/legacyAlpha.d.ts +1 -1
- package/lib/metadata.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +8 -2
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/duplicateBatchDetector.js +18 -18
- package/lib/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/lib/opLifecycle/index.d.ts +2 -2
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js +2 -2
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.js +3 -2
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +10 -6
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +3 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSerialization.d.ts +11 -1
- package/lib/opLifecycle/opSerialization.d.ts.map +1 -1
- package/lib/opLifecycle/opSerialization.js +16 -0
- package/lib/opLifecycle/opSerialization.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +17 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +44 -7
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +14 -10
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +4 -1
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/opProperties.d.ts.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.js +52 -45
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/runCounter.js +10 -30
- package/lib/runCounter.js.map +1 -1
- package/lib/runtimeLayerCompatState.d.ts +1 -1
- package/lib/runtimeLayerCompatState.d.ts.map +1 -1
- package/lib/runtimeLayerCompatState.js +28 -8
- package/lib/runtimeLayerCompatState.js.map +1 -1
- package/lib/signalTelemetryProcessing.js +15 -17
- package/lib/signalTelemetryProcessing.js.map +1 -1
- package/lib/storageServiceWithAttachBlobs.js +2 -0
- package/lib/storageServiceWithAttachBlobs.js.map +1 -1
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +51 -13
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/orderedClientElection.js +25 -17
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js +18 -7
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +22 -13
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +20 -6
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerUtils.d.ts.map +1 -1
- package/lib/summary/summarizerUtils.js +1 -0
- package/lib/summary/summarizerUtils.js.map +1 -1
- package/lib/summary/summaryCollection.js +23 -11
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.js +4 -2
- package/lib/summary/summaryDelayLoadedModule/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js +65 -46
- package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summarizer.js +15 -6
- package/lib/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summarizerHeuristics.js +30 -25
- package/lib/summary/summaryDelayLoadedModule/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js +9 -0
- package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryDelayLoadedModule/summaryResultBuilder.js +3 -5
- package/lib/summary/summaryDelayLoadedModule/summaryResultBuilder.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +66 -54
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/throttler.d.ts.map +1 -1
- package/lib/throttler.js +4 -1
- package/lib/throttler.js.map +1 -1
- package/lib/versionMarks/inboundBatch.d.ts +8 -6
- package/lib/versionMarks/inboundBatch.d.ts.map +1 -1
- package/lib/versionMarks/inboundBatch.js +10 -5
- package/lib/versionMarks/inboundBatch.js.map +1 -1
- package/lib/versionMarks/versionMarkResolver.d.ts +30 -23
- package/lib/versionMarks/versionMarkResolver.d.ts.map +1 -1
- package/lib/versionMarks/versionMarkResolver.js +112 -63
- package/lib/versionMarks/versionMarkResolver.js.map +1 -1
- package/package.json +60 -102
- package/src/containerCompatibility.ts +33 -42
- package/src/containerRuntime.ts +15 -12
- package/src/opLifecycle/index.ts +7 -1
- package/src/opLifecycle/opCompressor.ts +2 -2
- package/src/opLifecycle/opSerialization.ts +22 -1
- package/src/opLifecycle/opSplitter.ts +63 -6
- package/src/packageVersion.ts +1 -1
- package/src/runtimeLayerCompatState.ts +28 -21
- package/src/summary/documentSchema.ts +31 -6
- package/src/versionMarks/DEV.md +595 -158
- package/src/versionMarks/inboundBatch.ts +18 -8
- package/src/versionMarks/versionMarkResolver.ts +144 -75
- package/tsconfig.json +1 -1
- package/internal.d.ts +0 -11
- package/legacy/alpha.d.ts +0 -11
- package/legacy.d.ts +0 -11
- /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
- /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summaryManager.js","sourceRoot":"","sources":["../../src/summary/summaryManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAWjE,kEAA6D;AAC7D,0EAA+E;AAC/E,uEAIkD;AAUlD,6DAAmE;AAOnE,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,8BAA8B,GAAG,IAAI,CAAC;AAE5C,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC9B,2DAAO,CAAA;IACP,qEAAY,CAAA;IACZ,mEAAW,CAAA;IACX,qEAAY,CAAA;AACb,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AA0CD;;;;GAIG;AACH,MAAa,cACZ,SAAQ,gCAAoC;IAqB5C,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB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ved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tISummarizerEvents,\n\tSummarizerStopReason,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tIDisposable,\n\tIEvent,\n\tIEventProvider,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { DriverErrorTypes } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tcreateChildLogger,\n\tPerformanceEvent,\n\ttype TelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { IThrottler } from \"../throttler.js\";\n\nimport type { ISummarizerClientElection } from \"./summarizerClientElection.js\";\nimport type {\n\tIEnqueueSummarizeOptions,\n\tIOnDemandSummarizeOptions,\n\tISummarizer,\n} from \"./summarizerTypes.js\";\nimport { stopReasonCanRunLastSummary } from \"./summarizerUtils.js\";\nimport type { SummaryCollection } from \"./summaryCollection.js\";\nimport type {\n\tEnqueueSummarizeResult,\n\tISummarizeResults,\n} from \"./summaryDelayLoadedModule/index.js\";\n\nconst defaultInitialDelayMs = 5000;\nconst defaultOpsToBypassInitialDelay = 4000;\n\nexport enum SummaryManagerState {\n\tOff = 0,\n\tStarting = 1,\n\tRunning = 2,\n\tStopping = 3,\n}\n\n// Please note that all reasons in this list are not errors,\n// and thus they are not raised today to parent container as error.\n// If this needs to be changed in future, we should re-evaluate what and how we raise to summarizer\ntype StopReason = Extract<\n\tSummarizerStopReason,\n\t\"parentNotConnected\" | \"notElectedParent\" | \"notElectedClient\"\n>;\ntype ShouldSummarizeState =\n\t| { shouldSummarize: true }\n\t| { shouldSummarize: false; stopReason: StopReason };\n\nexport interface IConnectedEvents extends IEvent {\n\t(event: \"connected\", listener: (clientId: string) => void);\n\t(event: \"disconnected\", listener: () => void);\n}\n\n/**\n * IConnectedState describes an object that SummaryManager can watch to observe connection/disconnection.\n *\n * Under current implementation, its role will be fulfilled by the ContainerRuntime, but this could be replaced\n * with anything else that fulfills the contract if we want to shift the layer that the SummaryManager lives at.\n */\nexport interface IConnectedState extends IEventProvider<IConnectedEvents> {\n\treadonly connected: boolean;\n\n\t/**\n\t * Under current implementation this is undefined if we've never connected, otherwise it's the clientId from our\n\t * latest connection (even if we've since disconnected!). Although this happens to be the behavior we want in\n\t * SummaryManager, I suspect that globally we may eventually want to modify this behavior (e.g. make clientId\n\t * undefined while disconnected). To protect against this, let's assume this field can't be trusted while\n\t * disconnected and instead separately track \"latest clientId\" in SummaryManager.\n\t */\n\treadonly clientId: string | undefined;\n}\n\nexport interface ISummaryManagerConfig {\n\tinitialDelayMs: number;\n\topsToBypassInitialDelay: number;\n}\n\n/**\n * SummaryManager is created by parent container (i.e. interactive container with clientType !== \"summarizer\") only.\n * It observes changes in calculated summarizer and reacts to changes by either creating summarizer client or\n * stopping existing summarizer client.\n */\nexport class SummaryManager\n\textends TypedEventEmitter<ISummarizerEvents>\n\timplements IDisposable\n{\n\tprivate readonly logger: TelemetryLoggerExt;\n\tprivate readonly opsToBypassInitialDelay: number;\n\tprivate readonly initialDelayMs: number;\n\tprivate latestClientId: string | undefined;\n\tprivate state = SummaryManagerState.Off;\n\tprivate summarizer?: ISummarizer;\n\tprivate pendingStopReason?: SummarizerStopReason;\n\tprivate _disposed = false;\n\tprivate summarizerStopTimeout?: ReturnType<typeof setTimeout>;\n\t/**\n\t * Monotonically increasing counter that tracks summarizer lifecycle generations.\n\t * Incremented each time {@link cleanupAfterSummarizerStop} runs. Used by the\n\t * promise chain in {@link startSummarization} to detect that cleanup has already\n\t * been performed by another path (e.g. the stop timeout), so it can skip\n\t * redundant cleanup that would corrupt the state machine.\n\t */\n\tprivate summarizerGeneration = 0;\n\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\tpublic get currentState(): SummaryManagerState {\n\t\treturn this.state;\n\t}\n\n\tconstructor(\n\t\tprivate readonly clientElection: ISummarizerClientElection,\n\t\tprivate readonly connectedState: IConnectedState,\n\t\tprivate readonly summaryCollection: Pick<\n\t\t\tSummaryCollection,\n\t\t\t\"opsSinceLastAck\" | \"addOpListener\" | \"removeOpListener\"\n\t\t>,\n\t\tparentLogger: ITelemetryBaseLogger,\n\t\t/**\n\t\t * Creates summarizer by asking interactive container to spawn summarizing container and\n\t\t * get back its Summarizer instance.\n\t\t */\n\t\tprivate readonly createSummarizerFn: () => Promise<ISummarizer>,\n\t\tprivate readonly startThrottler: IThrottler,\n\t\t{\n\t\t\tinitialDelayMs = defaultInitialDelayMs,\n\t\t\topsToBypassInitialDelay = defaultOpsToBypassInitialDelay,\n\t\t}: Readonly<Partial<ISummaryManagerConfig>> = {},\n\t) {\n\t\tsuper();\n\n\t\tthis.logger = createChildLogger({\n\t\t\tlogger: parentLogger,\n\t\t\tnamespace: \"SummaryManager\",\n\t\t\tproperties: {\n\t\t\t\tall: { clientId: () => this.latestClientId },\n\t\t\t},\n\t\t});\n\n\t\tthis.connectedState.on(\"connected\", this.handleConnected);\n\t\tthis.connectedState.on(\"disconnected\", this.handleDisconnected);\n\t\tthis.latestClientId = this.connectedState.clientId;\n\n\t\tthis.opsToBypassInitialDelay = opsToBypassInitialDelay;\n\t\tthis.initialDelayMs = initialDelayMs;\n\t}\n\n\t/**\n\t * Until start is called, the SummaryManager won't begin attempting to start summarization. This ensures there's\n\t * a window between construction and starting where the caller can attach listeners.\n\t */\n\tpublic start(): void {\n\t\tthis.clientElection.on(\"electedSummarizerChanged\", this.refreshSummarizer);\n\t\tthis.refreshSummarizer();\n\t}\n\n\tprivate readonly handleConnected = (clientId: string): void => {\n\t\tthis.latestClientId = clientId;\n\t\t// If we have a summarizer, it should have been either cancelled on disconnected by now.\n\t\t// But because of lastSummary process, it can still hang around, so there is not much we can\n\t\t// check or assert.\n\t\tthis.refreshSummarizer();\n\t};\n\n\tprivate readonly handleDisconnected = (): void => {\n\t\tthis.refreshSummarizer();\n\t};\n\n\tprivate static readonly isStartingOrRunning = (\n\t\tstate: SummaryManagerState,\n\t): state is SummaryManagerState.Starting | SummaryManagerState.Running =>\n\t\tstate === SummaryManagerState.Starting || state === SummaryManagerState.Running;\n\n\tprivate getShouldSummarizeState(): ShouldSummarizeState {\n\t\tif (this.disposed) {\n\t\t\treturn { shouldSummarize: false, stopReason: \"parentNotConnected\" };\n\t\t}\n\n\t\t// Note that if we're in the Running state, the electedClient may be a summarizer client, so we can't\n\t\t// enforce connectedState.clientId === clientElection.electedClientId. But once we're Running, we should\n\t\t// only transition to Stopping when the electedParentId changes. Stopping the summarizer without\n\t\t// changing the electedParent will just cause us to transition to Starting again.\n\n\t\t// New Parent has been elected and it is not the current client, or\n\t\tif (this.connectedState.clientId !== this.clientElection.electedParentId) {\n\t\t\treturn { shouldSummarize: false, stopReason: \"notElectedParent\" };\n\t\t}\n\n\t\t// We are not already running the summarizer and we are not the current elected client id.\n\t\tif (\n\t\t\tthis.state !== SummaryManagerState.Running &&\n\t\t\tthis.connectedState.clientId !== this.clientElection.electedClientId\n\t\t) {\n\t\t\treturn { shouldSummarize: false, stopReason: \"notElectedClient\" };\n\t\t}\n\n\t\tif (!this.connectedState.connected) {\n\t\t\treturn { shouldSummarize: false, stopReason: \"parentNotConnected\" };\n\t\t}\n\n\t\treturn { shouldSummarize: true };\n\t}\n\n\tprivate readonly refreshSummarizer = (): void => {\n\t\t// Transition states depending on shouldSummarize, which is a calculated property\n\t\t// that is only true if this client is connected and is the elected summarizer.\n\t\tconst shouldSummarizeState = this.getShouldSummarizeState();\n\t\tswitch (this.state) {\n\t\t\tcase SummaryManagerState.Off: {\n\t\t\t\tif (shouldSummarizeState.shouldSummarize) {\n\t\t\t\t\tthis.startSummarization();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase SummaryManagerState.Starting: {\n\t\t\t\t// Cannot take any action until summarizer is created\n\t\t\t\t// state transition will occur after creation\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase SummaryManagerState.Running: {\n\t\t\t\tif (shouldSummarizeState.shouldSummarize === false) {\n\t\t\t\t\tthis.stop(shouldSummarizeState.stopReason);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase SummaryManagerState.Stopping: {\n\t\t\t\t// Cannot take any action until running summarizer finishes\n\t\t\t\t// state transition will occur after it stops\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate startSummarization(): void {\n\t\tassert(this.state === SummaryManagerState.Off, 0x261 /* \"Expected: off\" */);\n\t\tthis.state = SummaryManagerState.Starting;\n\n\t\tassert(this.summarizer === undefined, 0x262 /* \"Old summarizer is still working!\" */);\n\n\t\tconst generation = this.summarizerGeneration;\n\n\t\tthis.delayBeforeCreatingSummarizer()\n\t\t\t.then(async (startWithInitialDelay: boolean) => {\n\t\t\t\tif (this.disposed) {\n\t\t\t\t\treturn \"early exit (disposed)\";\n\t\t\t\t}\n\n\t\t\t\t// Re-validate that it need to be running. Due to asynchrony, it may be not the case anymore\n\t\t\t\t// but only if creation was delayed. If it was not, then we want to ensure we always create\n\t\t\t\t// a summarizer to kick off lastSummary. Without that, we would not be able to summarize and get\n\t\t\t\t// document out of broken state if it has too many ops and ordering service keeps nacking main\n\t\t\t\t// container (and thus it goes into cycle of reconnects)\n\t\t\t\t// If we can't run the LastSummary, simply return as to avoid paying the cost of launching\n\t\t\t\t// the summarizer at all.\n\t\t\t\tconst shouldSummarizeStateEarlyStage = this.getShouldSummarizeState();\n\t\t\t\tif (\n\t\t\t\t\tstartWithInitialDelay &&\n\t\t\t\t\tshouldSummarizeStateEarlyStage.shouldSummarize === false\n\t\t\t\t) {\n\t\t\t\t\treturn `early exit ${shouldSummarizeStateEarlyStage.stopReason}`;\n\t\t\t\t}\n\n\t\t\t\t// We transition to Running before requesting the summarizer, because after requesting we can't predict\n\t\t\t\t// when the electedClient will be replaced with the new summarizer client.\n\t\t\t\t// The alternative would be to let connectedState.clientId !== clientElection.electedClientId when\n\t\t\t\t// state === Starting || state === Running.\n\t\t\t\tassert(this.state === SummaryManagerState.Starting, 0x263 /* \"Expected: starting\" */);\n\t\t\t\tthis.state = SummaryManagerState.Running;\n\n\t\t\t\tconst summarizer = await this.createSummarizerFn();\n\t\t\t\tthis.summarizer = summarizer;\n\t\t\t\tthis.setupForwardedEvents(summarizer);\n\n\t\t\t\t// A stop may have been requested while we were awaiting summarizer creation.\n\t\t\t\t// Replay it now so the summarizer can observe the stop intent and move to exit.\n\t\t\t\tif (this.pendingStopReason !== undefined) {\n\t\t\t\t\tsummarizer.stop(this.pendingStopReason);\n\t\t\t\t\tthis.pendingStopReason = undefined;\n\t\t\t\t}\n\n\t\t\t\t// Re-validate that it need to be running. Due to asynchrony, it may be not the case anymore\n\t\t\t\t// If we can't run the LastSummary, simply return as to avoid paying the cost of launching\n\t\t\t\t// the summarizer at all.\n\t\t\t\tconst shouldSummarizeState = this.getShouldSummarizeState();\n\t\t\t\tif (shouldSummarizeState.shouldSummarize === false) {\n\t\t\t\t\t// In order to allow the last summary to run, we not only need a stop reason that would\n\t\t\t\t\t// allow it but also, startWithInitialDelay to be false (start the summarization immediately),\n\t\t\t\t\t// which would happen when we have a high enough number of unsummarized ops.\n\t\t\t\t\tif (\n\t\t\t\t\t\tstartWithInitialDelay ||\n\t\t\t\t\t\t!stopReasonCanRunLastSummary(shouldSummarizeState.stopReason)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.state = SummaryManagerState.Starting;\n\t\t\t\t\t\tsummarizer.stop(shouldSummarizeState.stopReason);\n\t\t\t\t\t\treturn `early exit after starting summarizer ${shouldSummarizeState.stopReason}`;\n\t\t\t\t\t}\n\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\teventName: \"LastAttemptToSummarize\",\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst clientId = this.latestClientId!;\n\n\t\t\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\t\t\tthis.logger,\n\t\t\t\t\t{ eventName: \"RunningSummarizer\", attempt: this.startThrottler.numAttempts },\n\t\t\t\t\tasync () => summarizer.run(clientId),\n\t\t\t\t);\n\t\t\t})\n\t\t\t.then((reason: string) => {\n\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"EndingSummarizer\",\n\t\t\t\t\treason,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthis.logger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"EndingSummarizer\",\n\t\t\t\t\t\treason: \"exception\",\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\n\t\t\t\t// Most of exceptions happen due to container being closed while loading it, due to\n\t\t\t\t// summarizer container loosing connection while load.\n\t\t\t\t// Not worth reporting such errors as errors. That said, we might miss some real errors if\n\t\t\t\t// we ignore blindly, so try to narrow signature we are looking for - skip logging\n\t\t\t\t// error only if this client should no longer be a summarizer (which in practice\n\t\t\t\t// means it also lost connection), and error happened on load (we do not have summarizer).\n\t\t\t\t// We could annotate the error raised in Container.load where the container closed during load with no error\n\t\t\t\t// and check for that case here, but that does not seem to be necessary.\n\t\t\t\tif (this.getShouldSummarizeState().shouldSummarize || this.summarizer !== undefined) {\n\t\t\t\t\t// Report any failure as an error unless it was due to cancellation (like \"disconnected\" error)\n\t\t\t\t\t// If failure happened on container load, we may not yet realized that socket disconnected, so check\n\t\t\t\t\t// offlineError.\n\t\t\t\t\tconst category =\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\t\t\terror?.errorType === DriverErrorTypes.offlineError ? \"generic\" : \"error\";\n\t\t\t\t\tthis.logger.sendTelemetryEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: \"SummarizerException\",\n\t\t\t\t\t\t\tcategory,\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tif (generation !== this.summarizerGeneration) {\n\t\t\t\t\t// Cleanup was already performed by another path (e.g. the stop timeout),\n\t\t\t\t\t// and a new summarizer cycle may have started. Running cleanup again\n\t\t\t\t\t// would corrupt the current state machine cycle.\n\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\teventName: \"SummarizerCleanupAlreadyDone\",\n\t\t\t\t\t\tcurrentState: this.state,\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tassert(this.state !== SummaryManagerState.Off, 0x264 /* \"Expected: Not Off\" */);\n\t\t\t\tthis.cleanupAfterSummarizerStop();\n\t\t\t});\n\t}\n\n\tprivate cleanupAfterSummarizerStop(): void {\n\t\tthis.summarizerGeneration++;\n\t\tthis.state = SummaryManagerState.Off;\n\t\tthis.pendingStopReason = undefined;\n\n\t\t// Clear any pending stop timeout to avoid it firing for a different summarizer\n\t\tif (this.summarizerStopTimeout !== undefined) {\n\t\t\tclearTimeout(this.summarizerStopTimeout);\n\t\t\tthis.summarizerStopTimeout = undefined;\n\t\t}\n\n\t\tthis.cleanupForwardedEvents();\n\t\tthis.summarizer?.close();\n\t\tthis.summarizer = undefined;\n\n\t\tif (this.getShouldSummarizeState().shouldSummarize) {\n\t\t\tthis.startSummarization();\n\t\t}\n\t}\n\n\tprivate stop(reason: SummarizerStopReason): void {\n\t\tif (!SummaryManager.isStartingOrRunning(this.state)) {\n\t\t\treturn;\n\t\t}\n\t\tthis.state = SummaryManagerState.Stopping;\n\t\tthis.pendingStopReason = reason;\n\n\t\t// Stopping the running summarizer client should trigger a change\n\t\t// in states when the running summarizer closes\n\t\tthis.summarizer?.stop(reason);\n\n\t\tconst summarizerCloseTimeoutMs = 2 * 60 * 1000; // 2 minutes\n\t\t// Clear any existing timeout before setting a new one\n\t\tif (this.summarizerStopTimeout !== undefined) {\n\t\t\tclearTimeout(this.summarizerStopTimeout);\n\t\t}\n\t\t// Set a timeout to force cleanup if the summarizer doesn't close in time\n\t\tthis.summarizerStopTimeout = setTimeout(() => {\n\t\t\tif (this.state === SummaryManagerState.Stopping && this.summarizer !== undefined) {\n\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"SummarizerStopTimeout\",\n\t\t\t\t\ttimeoutMs: summarizerCloseTimeoutMs,\n\t\t\t\t\tstopReason: reason,\n\t\t\t\t});\n\t\t\t\tthis.cleanupAfterSummarizerStop();\n\t\t\t}\n\t\t}, summarizerCloseTimeoutMs);\n\t}\n\n\t/**\n\t * Implements initial delay before creating summarizer\n\t * @returns `true`, if creation is delayed due to heuristics (not many ops to summarize).\n\t * `false` if summarizer should start immediately due to too many unsummarized ops.\n\t */\n\tprivate async delayBeforeCreatingSummarizer(): Promise<boolean> {\n\t\t// throttle creation of new summarizer containers to prevent spamming the server with websocket connections\n\t\tlet delayMs = this.startThrottler.getDelay();\n\n\t\t// We have been elected the summarizer. Some day we may be able to summarize with a live document but for\n\t\t// now we play it safe and launch a second copy.\n\t\tthis.logger.sendTelemetryEvent({\n\t\t\teventName: \"CreatingSummarizer\",\n\t\t\tthrottlerDelay: delayMs,\n\t\t\tinitialDelay: this.initialDelayMs,\n\t\t\tstartThrottlerMaxDelayMs: this.startThrottler.maxDelayMs,\n\t\t\topsSinceLastAck: this.summaryCollection.opsSinceLastAck,\n\t\t\topsToBypassInitialDelay: this.opsToBypassInitialDelay,\n\t\t\telectedParentId: this.clientElection.electedParentId,\n\t\t\telectedClientId: this.clientElection.electedClientId,\n\t\t});\n\n\t\t// This delay helps ensure that last summarizer that might be left from previous client\n\t\t// has enough time to complete its last summary and thus new summarizer not conflict with previous one.\n\t\t// If, however, there are too many unsummarized ops, try to resolve it as quickly as possible, with\n\t\t// understanding that we may see nacks because of such quick action.\n\t\t// A better design would be for summarizer election logic to always select current summarizer as\n\t\t// summarizing client (i.e. clientType === \"summarizer\" can be elected) to ensure that nobody else can\n\t\t// summarizer while it finishes its work and moves to exit.\n\t\t// It also helps with pure boot scenario (single client) to offset expensive work a bit out from\n\t\t// critical boot sequence.\n\t\tlet startWithInitialDelay = false;\n\t\tif (this.summaryCollection.opsSinceLastAck < this.opsToBypassInitialDelay) {\n\t\t\tstartWithInitialDelay = true;\n\t\t\tdelayMs = Math.max(delayMs, this.initialDelayMs);\n\t\t}\n\n\t\tif (delayMs > 0) {\n\t\t\tlet timer: number | undefined;\n\t\t\tlet resolveOpPromiseFn: (value: void | PromiseLike<void>) => void;\n\t\t\t// Create a listener that will break the delay if we've exceeded the initial delay ops count.\n\t\t\tconst opsListenerFn = (): void => {\n\t\t\t\tif (this.summaryCollection.opsSinceLastAck >= this.opsToBypassInitialDelay) {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\tresolveOpPromiseFn();\n\t\t\t\t}\n\t\t\t};\n\t\t\t// Create a Promise that will resolve when the delay expires.\n\t\t\tconst delayPromise = new Promise<void>((resolve) => {\n\t\t\t\ttimer = setTimeout(() => resolve(), delayMs);\n\t\t\t});\n\t\t\t// Create a Promise that will resolve if the ops count passes the threshold.\n\t\t\tconst opPromise = new Promise<void>((resolve) => {\n\t\t\t\tresolveOpPromiseFn = resolve;\n\t\t\t});\n\t\t\tthis.summaryCollection.addOpListener(opsListenerFn);\n\t\t\tawait Promise.race([delayPromise, opPromise]);\n\t\t\tthis.summaryCollection.removeOpListener(opsListenerFn);\n\t\t}\n\t\treturn startWithInitialDelay;\n\t}\n\n\tpublic summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults {\n\t\tif (this.summarizer === undefined) {\n\t\t\tthrow new Error(\"No running summarizer client\");\n\t\t\t// TODO: could spawn a summarizer client temporarily.\n\t\t}\n\t\treturn this.summarizer.summarizeOnDemand(options);\n\t}\n\n\tpublic enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult {\n\t\tif (this.summarizer === undefined) {\n\t\t\tthrow new Error(\"No running summarizer client\");\n\t\t\t// TODO: could spawn a summarizer client temporarily.\n\t\t}\n\t\treturn this.summarizer.enqueueSummarize(options);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.clientElection.off(\"electedSummarizerChanged\", this.refreshSummarizer);\n\t\tthis.connectedState.off(\"connected\", this.handleConnected);\n\t\tthis.connectedState.off(\"disconnected\", this.handleDisconnected);\n\t\tthis.cleanupForwardedEvents();\n\t\tthis.pendingStopReason = undefined;\n\t\tif (this.summarizerStopTimeout !== undefined) {\n\t\t\tclearTimeout(this.summarizerStopTimeout);\n\t\t}\n\t\tthis._disposed = true;\n\t}\n\n\tprivate readonly forwardedEventsCleanup: (() => void)[] = [];\n\n\tprivate setupForwardedEvents(summarizer: ISummarizer): void {\n\t\tfor (const event of [\n\t\t\t\"summarize\",\n\t\t\t\"summarizeAllAttemptsFailed\",\n\t\t\t\"summarizerStop\",\n\t\t\t\"summarizerStart\",\n\t\t\t\"summarizerStartupFailed\",\n\t\t\t\"summarizeTimeout\",\n\t\t] as const) {\n\t\t\tconst listener = (...args: unknown[]): void => {\n\t\t\t\tthis.emit(event, ...args);\n\t\t\t};\n\t\t\t// TODO: better typing here\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument\n\t\t\tsummarizer.on(event as any, listener);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument\n\t\t\tthis.forwardedEventsCleanup.push(() => summarizer.off(event as any, listener));\n\t\t}\n\t}\n\n\tprivate cleanupForwardedEvents(): void {\n\t\tfor (const cleanup of this.forwardedEventsCleanup) {\n\t\t\tcleanup();\n\t\t}\n\t\tthis.forwardedEventsCleanup.length = 0;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"summaryManager.js","sourceRoot":"","sources":["../../src/summary/summaryManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAWjE,kEAA6D;AAC7D,0EAA+E;AAC/E,uEAIkD;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AC;YAC3B,CAAC,CAAC;YACF,2BAA2B;YAC3B,qGAAqG;YACrG,UAAU,CAAC,EAAE,CAAC,KAAY,EAAE,QAAQ,CAAC,CAAC;YACtC,qGAAqG;YACrG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,KAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;QAChF,CAAC;IACF,CAAC;IAEO,sBAAsB;QAC7B,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;YACnD,OAAO,EAAE,CAAC;QACX,CAAC;QACD,IAAI,CAAC,sBAAsB,CAAC,MAAM,GAAG,CAAC,CAAC;IACxC,CAAC;;AAtcF,wCAucC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tISummarizerEvents,\n\tSummarizerStopReason,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tIDisposable,\n\tIEvent,\n\tIEventProvider,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { DriverErrorTypes } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tcreateChildLogger,\n\tPerformanceEvent,\n\ttype TelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { IThrottler } from \"../throttler.js\";\n\nimport type { ISummarizerClientElection } from \"./summarizerClientElection.js\";\nimport type {\n\tIEnqueueSummarizeOptions,\n\tIOnDemandSummarizeOptions,\n\tISummarizer,\n} from \"./summarizerTypes.js\";\nimport { stopReasonCanRunLastSummary } from \"./summarizerUtils.js\";\nimport type { SummaryCollection } from \"./summaryCollection.js\";\nimport type {\n\tEnqueueSummarizeResult,\n\tISummarizeResults,\n} from \"./summaryDelayLoadedModule/index.js\";\n\nconst defaultInitialDelayMs = 5000;\nconst defaultOpsToBypassInitialDelay = 4000;\n\nexport enum SummaryManagerState {\n\tOff = 0,\n\tStarting = 1,\n\tRunning = 2,\n\tStopping = 3,\n}\n\n// Please note that all reasons in this list are not errors,\n// and thus they are not raised today to parent container as error.\n// If this needs to be changed in future, we should re-evaluate what and how we raise to summarizer\ntype StopReason = Extract<\n\tSummarizerStopReason,\n\t\"parentNotConnected\" | \"notElectedParent\" | \"notElectedClient\"\n>;\ntype ShouldSummarizeState =\n\t| { shouldSummarize: true }\n\t| { shouldSummarize: false; stopReason: StopReason };\n\nexport interface IConnectedEvents extends IEvent {\n\t(event: \"connected\", listener: (clientId: string) => void);\n\t(event: \"disconnected\", listener: () => void);\n}\n\n/**\n * IConnectedState describes an object that SummaryManager can watch to observe connection/disconnection.\n *\n * Under current implementation, its role will be fulfilled by the ContainerRuntime, but this could be replaced\n * with anything else that fulfills the contract if we want to shift the layer that the SummaryManager lives at.\n */\nexport interface IConnectedState extends IEventProvider<IConnectedEvents> {\n\treadonly connected: boolean;\n\n\t/**\n\t * Under current implementation this is undefined if we've never connected, otherwise it's the clientId from our\n\t * latest connection (even if we've since disconnected!). Although this happens to be the behavior we want in\n\t * SummaryManager, I suspect that globally we may eventually want to modify this behavior (e.g. make clientId\n\t * undefined while disconnected). To protect against this, let's assume this field can't be trusted while\n\t * disconnected and instead separately track \"latest clientId\" in SummaryManager.\n\t */\n\treadonly clientId: string | undefined;\n}\n\nexport interface ISummaryManagerConfig {\n\tinitialDelayMs: number;\n\topsToBypassInitialDelay: number;\n}\n\n/**\n * SummaryManager is created by parent container (i.e. interactive container with clientType !== \"summarizer\") only.\n * It observes changes in calculated summarizer and reacts to changes by either creating summarizer client or\n * stopping existing summarizer client.\n */\nexport class SummaryManager\n\textends TypedEventEmitter<ISummarizerEvents>\n\timplements IDisposable\n{\n\tprivate readonly logger: TelemetryLoggerExt;\n\tprivate readonly opsToBypassInitialDelay: number;\n\tprivate readonly initialDelayMs: number;\n\tprivate latestClientId: string | undefined;\n\tprivate state = SummaryManagerState.Off;\n\tprivate summarizer?: ISummarizer;\n\tprivate pendingStopReason?: SummarizerStopReason;\n\tprivate _disposed = false;\n\tprivate summarizerStopTimeout?: ReturnType<typeof setTimeout>;\n\t/**\n\t * Monotonically increasing counter that tracks summarizer lifecycle generations.\n\t * Incremented each time {@link cleanupAfterSummarizerStop} runs. Used by the\n\t * promise chain in {@link startSummarization} to detect that cleanup has already\n\t * been performed by another path (e.g. the stop timeout), so it can skip\n\t * redundant cleanup that would corrupt the state machine.\n\t */\n\tprivate summarizerGeneration = 0;\n\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\tpublic get currentState(): SummaryManagerState {\n\t\treturn this.state;\n\t}\n\n\tconstructor(\n\t\tprivate readonly clientElection: ISummarizerClientElection,\n\t\tprivate readonly connectedState: IConnectedState,\n\t\tprivate readonly summaryCollection: Pick<\n\t\t\tSummaryCollection,\n\t\t\t\"opsSinceLastAck\" | \"addOpListener\" | \"removeOpListener\"\n\t\t>,\n\t\tparentLogger: ITelemetryBaseLogger,\n\t\t/**\n\t\t * Creates summarizer by asking interactive container to spawn summarizing container and\n\t\t * get back its Summarizer instance.\n\t\t */\n\t\tprivate readonly createSummarizerFn: () => Promise<ISummarizer>,\n\t\tprivate readonly startThrottler: IThrottler,\n\t\t{\n\t\t\tinitialDelayMs = defaultInitialDelayMs,\n\t\t\topsToBypassInitialDelay = defaultOpsToBypassInitialDelay,\n\t\t}: Readonly<Partial<ISummaryManagerConfig>> = {},\n\t) {\n\t\tsuper();\n\n\t\tthis.logger = createChildLogger({\n\t\t\tlogger: parentLogger,\n\t\t\tnamespace: \"SummaryManager\",\n\t\t\tproperties: {\n\t\t\t\tall: { clientId: () => this.latestClientId },\n\t\t\t},\n\t\t});\n\n\t\tthis.connectedState.on(\"connected\", this.handleConnected);\n\t\tthis.connectedState.on(\"disconnected\", this.handleDisconnected);\n\t\tthis.latestClientId = this.connectedState.clientId;\n\n\t\tthis.opsToBypassInitialDelay = opsToBypassInitialDelay;\n\t\tthis.initialDelayMs = initialDelayMs;\n\t}\n\n\t/**\n\t * Until start is called, the SummaryManager won't begin attempting to start summarization. This ensures there's\n\t * a window between construction and starting where the caller can attach listeners.\n\t */\n\tpublic start(): void {\n\t\tthis.clientElection.on(\"electedSummarizerChanged\", this.refreshSummarizer);\n\t\tthis.refreshSummarizer();\n\t}\n\n\tprivate readonly handleConnected = (clientId: string): void => {\n\t\tthis.latestClientId = clientId;\n\t\t// If we have a summarizer, it should have been either cancelled on disconnected by now.\n\t\t// But because of lastSummary process, it can still hang around, so there is not much we can\n\t\t// check or assert.\n\t\tthis.refreshSummarizer();\n\t};\n\n\tprivate readonly handleDisconnected = (): void => {\n\t\tthis.refreshSummarizer();\n\t};\n\n\tprivate static readonly isStartingOrRunning = (\n\t\tstate: SummaryManagerState,\n\t): state is SummaryManagerState.Starting | SummaryManagerState.Running =>\n\t\tstate === SummaryManagerState.Starting || state === SummaryManagerState.Running;\n\n\tprivate getShouldSummarizeState(): ShouldSummarizeState {\n\t\tif (this.disposed) {\n\t\t\treturn { shouldSummarize: false, stopReason: \"parentNotConnected\" };\n\t\t}\n\n\t\t// Note that if we're in the Running state, the electedClient may be a summarizer client, so we can't\n\t\t// enforce connectedState.clientId === clientElection.electedClientId. But once we're Running, we should\n\t\t// only transition to Stopping when the electedParentId changes. Stopping the summarizer without\n\t\t// changing the electedParent will just cause us to transition to Starting again.\n\n\t\t// New Parent has been elected and it is not the current client, or\n\t\tif (this.connectedState.clientId !== this.clientElection.electedParentId) {\n\t\t\treturn { shouldSummarize: false, stopReason: \"notElectedParent\" };\n\t\t}\n\n\t\t// We are not already running the summarizer and we are not the current elected client id.\n\t\tif (\n\t\t\tthis.state !== SummaryManagerState.Running &&\n\t\t\tthis.connectedState.clientId !== this.clientElection.electedClientId\n\t\t) {\n\t\t\treturn { shouldSummarize: false, stopReason: \"notElectedClient\" };\n\t\t}\n\n\t\tif (!this.connectedState.connected) {\n\t\t\treturn { shouldSummarize: false, stopReason: \"parentNotConnected\" };\n\t\t}\n\n\t\treturn { shouldSummarize: true };\n\t}\n\n\tprivate readonly refreshSummarizer = (): void => {\n\t\t// Transition states depending on shouldSummarize, which is a calculated property\n\t\t// that is only true if this client is connected and is the elected summarizer.\n\t\tconst shouldSummarizeState = this.getShouldSummarizeState();\n\t\tswitch (this.state) {\n\t\t\tcase SummaryManagerState.Off: {\n\t\t\t\tif (shouldSummarizeState.shouldSummarize) {\n\t\t\t\t\tthis.startSummarization();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase SummaryManagerState.Starting: {\n\t\t\t\t// Cannot take any action until summarizer is created\n\t\t\t\t// state transition will occur after creation\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase SummaryManagerState.Running: {\n\t\t\t\tif (shouldSummarizeState.shouldSummarize === false) {\n\t\t\t\t\tthis.stop(shouldSummarizeState.stopReason);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase SummaryManagerState.Stopping: {\n\t\t\t\t// Cannot take any action until running summarizer finishes\n\t\t\t\t// state transition will occur after it stops\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate startSummarization(): void {\n\t\tassert(this.state === SummaryManagerState.Off, 0x261 /* \"Expected: off\" */);\n\t\tthis.state = SummaryManagerState.Starting;\n\n\t\tassert(this.summarizer === undefined, 0x262 /* \"Old summarizer is still working!\" */);\n\n\t\tconst generation = this.summarizerGeneration;\n\n\t\tthis.delayBeforeCreatingSummarizer()\n\t\t\t.then(async (startWithInitialDelay: boolean) => {\n\t\t\t\tif (this.disposed) {\n\t\t\t\t\treturn \"early exit (disposed)\";\n\t\t\t\t}\n\n\t\t\t\t// Re-validate that it need to be running. Due to asynchrony, it may be not the case anymore\n\t\t\t\t// but only if creation was delayed. If it was not, then we want to ensure we always create\n\t\t\t\t// a summarizer to kick off lastSummary. Without that, we would not be able to summarize and get\n\t\t\t\t// document out of broken state if it has too many ops and ordering service keeps nacking main\n\t\t\t\t// container (and thus it goes into cycle of reconnects)\n\t\t\t\t// If we can't run the LastSummary, simply return as to avoid paying the cost of launching\n\t\t\t\t// the summarizer at all.\n\t\t\t\tconst shouldSummarizeStateEarlyStage = this.getShouldSummarizeState();\n\t\t\t\tif (\n\t\t\t\t\tstartWithInitialDelay &&\n\t\t\t\t\tshouldSummarizeStateEarlyStage.shouldSummarize === false\n\t\t\t\t) {\n\t\t\t\t\treturn `early exit ${shouldSummarizeStateEarlyStage.stopReason}`;\n\t\t\t\t}\n\n\t\t\t\t// We transition to Running before requesting the summarizer, because after requesting we can't predict\n\t\t\t\t// when the electedClient will be replaced with the new summarizer client.\n\t\t\t\t// The alternative would be to let connectedState.clientId !== clientElection.electedClientId when\n\t\t\t\t// state === Starting || state === Running.\n\t\t\t\tassert(this.state === SummaryManagerState.Starting, 0x263 /* \"Expected: starting\" */);\n\t\t\t\tthis.state = SummaryManagerState.Running;\n\n\t\t\t\tconst summarizer = await this.createSummarizerFn();\n\t\t\t\tthis.summarizer = summarizer;\n\t\t\t\tthis.setupForwardedEvents(summarizer);\n\n\t\t\t\t// A stop may have been requested while we were awaiting summarizer creation.\n\t\t\t\t// Replay it now so the summarizer can observe the stop intent and move to exit.\n\t\t\t\tif (this.pendingStopReason !== undefined) {\n\t\t\t\t\tsummarizer.stop(this.pendingStopReason);\n\t\t\t\t\tthis.pendingStopReason = undefined;\n\t\t\t\t}\n\n\t\t\t\t// Re-validate that it need to be running. Due to asynchrony, it may be not the case anymore\n\t\t\t\t// If we can't run the LastSummary, simply return as to avoid paying the cost of launching\n\t\t\t\t// the summarizer at all.\n\t\t\t\tconst shouldSummarizeState = this.getShouldSummarizeState();\n\t\t\t\tif (shouldSummarizeState.shouldSummarize === false) {\n\t\t\t\t\t// In order to allow the last summary to run, we not only need a stop reason that would\n\t\t\t\t\t// allow it but also, startWithInitialDelay to be false (start the summarization immediately),\n\t\t\t\t\t// which would happen when we have a high enough number of unsummarized ops.\n\t\t\t\t\tif (\n\t\t\t\t\t\tstartWithInitialDelay ||\n\t\t\t\t\t\t!stopReasonCanRunLastSummary(shouldSummarizeState.stopReason)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.state = SummaryManagerState.Starting;\n\t\t\t\t\t\tsummarizer.stop(shouldSummarizeState.stopReason);\n\t\t\t\t\t\treturn `early exit after starting summarizer ${shouldSummarizeState.stopReason}`;\n\t\t\t\t\t}\n\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\teventName: \"LastAttemptToSummarize\",\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst clientId = this.latestClientId!;\n\n\t\t\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\t\t\tthis.logger,\n\t\t\t\t\t{ eventName: \"RunningSummarizer\", attempt: this.startThrottler.numAttempts },\n\t\t\t\t\tasync () => summarizer.run(clientId),\n\t\t\t\t);\n\t\t\t})\n\t\t\t.then((reason: string) => {\n\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"EndingSummarizer\",\n\t\t\t\t\treason,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthis.logger.sendTelemetryEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"EndingSummarizer\",\n\t\t\t\t\t\treason: \"exception\",\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\n\t\t\t\t// Most of exceptions happen due to container being closed while loading it, due to\n\t\t\t\t// summarizer container loosing connection while load.\n\t\t\t\t// Not worth reporting such errors as errors. That said, we might miss some real errors if\n\t\t\t\t// we ignore blindly, so try to narrow signature we are looking for - skip logging\n\t\t\t\t// error only if this client should no longer be a summarizer (which in practice\n\t\t\t\t// means it also lost connection), and error happened on load (we do not have summarizer).\n\t\t\t\t// We could annotate the error raised in Container.load where the container closed during load with no error\n\t\t\t\t// and check for that case here, but that does not seem to be necessary.\n\t\t\t\tif (this.getShouldSummarizeState().shouldSummarize || this.summarizer !== undefined) {\n\t\t\t\t\t// Report any failure as an error unless it was due to cancellation (like \"disconnected\" error)\n\t\t\t\t\t// If failure happened on container load, we may not yet realized that socket disconnected, so check\n\t\t\t\t\t// offlineError.\n\t\t\t\t\tconst category =\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\t\t\terror?.errorType === DriverErrorTypes.offlineError ? \"generic\" : \"error\";\n\t\t\t\t\tthis.logger.sendTelemetryEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: \"SummarizerException\",\n\t\t\t\t\t\t\tcategory,\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tif (generation !== this.summarizerGeneration) {\n\t\t\t\t\t// Cleanup was already performed by another path (e.g. the stop timeout),\n\t\t\t\t\t// and a new summarizer cycle may have started. Running cleanup again\n\t\t\t\t\t// would corrupt the current state machine cycle.\n\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\teventName: \"SummarizerCleanupAlreadyDone\",\n\t\t\t\t\t\tcurrentState: this.state,\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tassert(this.state !== SummaryManagerState.Off, 0x264 /* \"Expected: Not Off\" */);\n\t\t\t\tthis.cleanupAfterSummarizerStop();\n\t\t\t});\n\t}\n\n\tprivate cleanupAfterSummarizerStop(): void {\n\t\tthis.summarizerGeneration++;\n\t\tthis.state = SummaryManagerState.Off;\n\t\tthis.pendingStopReason = undefined;\n\n\t\t// Clear any pending stop timeout to avoid it firing for a different summarizer\n\t\tif (this.summarizerStopTimeout !== undefined) {\n\t\t\tclearTimeout(this.summarizerStopTimeout);\n\t\t\tthis.summarizerStopTimeout = undefined;\n\t\t}\n\n\t\tthis.cleanupForwardedEvents();\n\t\tthis.summarizer?.close();\n\t\tthis.summarizer = undefined;\n\n\t\tif (this.getShouldSummarizeState().shouldSummarize) {\n\t\t\tthis.startSummarization();\n\t\t}\n\t}\n\n\tprivate stop(reason: SummarizerStopReason): void {\n\t\tif (!SummaryManager.isStartingOrRunning(this.state)) {\n\t\t\treturn;\n\t\t}\n\t\tthis.state = SummaryManagerState.Stopping;\n\t\tthis.pendingStopReason = reason;\n\n\t\t// Stopping the running summarizer client should trigger a change\n\t\t// in states when the running summarizer closes\n\t\tthis.summarizer?.stop(reason);\n\n\t\tconst summarizerCloseTimeoutMs = 2 * 60 * 1000; // 2 minutes\n\t\t// Clear any existing timeout before setting a new one\n\t\tif (this.summarizerStopTimeout !== undefined) {\n\t\t\tclearTimeout(this.summarizerStopTimeout);\n\t\t}\n\t\t// Set a timeout to force cleanup if the summarizer doesn't close in time\n\t\tthis.summarizerStopTimeout = setTimeout(() => {\n\t\t\tif (this.state === SummaryManagerState.Stopping && this.summarizer !== undefined) {\n\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"SummarizerStopTimeout\",\n\t\t\t\t\ttimeoutMs: summarizerCloseTimeoutMs,\n\t\t\t\t\tstopReason: reason,\n\t\t\t\t});\n\t\t\t\tthis.cleanupAfterSummarizerStop();\n\t\t\t}\n\t\t}, summarizerCloseTimeoutMs);\n\t}\n\n\t/**\n\t * Implements initial delay before creating summarizer\n\t * @returns `true`, if creation is delayed due to heuristics (not many ops to summarize).\n\t * `false` if summarizer should start immediately due to too many unsummarized ops.\n\t */\n\tprivate async delayBeforeCreatingSummarizer(): Promise<boolean> {\n\t\t// throttle creation of new summarizer containers to prevent spamming the server with websocket connections\n\t\tlet delayMs = this.startThrottler.getDelay();\n\n\t\t// We have been elected the summarizer. Some day we may be able to summarize with a live document but for\n\t\t// now we play it safe and launch a second copy.\n\t\tthis.logger.sendTelemetryEvent({\n\t\t\teventName: \"CreatingSummarizer\",\n\t\t\tthrottlerDelay: delayMs,\n\t\t\tinitialDelay: this.initialDelayMs,\n\t\t\tstartThrottlerMaxDelayMs: this.startThrottler.maxDelayMs,\n\t\t\topsSinceLastAck: this.summaryCollection.opsSinceLastAck,\n\t\t\topsToBypassInitialDelay: this.opsToBypassInitialDelay,\n\t\t\telectedParentId: this.clientElection.electedParentId,\n\t\t\telectedClientId: this.clientElection.electedClientId,\n\t\t});\n\n\t\t// This delay helps ensure that last summarizer that might be left from previous client\n\t\t// has enough time to complete its last summary and thus new summarizer not conflict with previous one.\n\t\t// If, however, there are too many unsummarized ops, try to resolve it as quickly as possible, with\n\t\t// understanding that we may see nacks because of such quick action.\n\t\t// A better design would be for summarizer election logic to always select current summarizer as\n\t\t// summarizing client (i.e. clientType === \"summarizer\" can be elected) to ensure that nobody else can\n\t\t// summarizer while it finishes its work and moves to exit.\n\t\t// It also helps with pure boot scenario (single client) to offset expensive work a bit out from\n\t\t// critical boot sequence.\n\t\tlet startWithInitialDelay = false;\n\t\tif (this.summaryCollection.opsSinceLastAck < this.opsToBypassInitialDelay) {\n\t\t\tstartWithInitialDelay = true;\n\t\t\tdelayMs = Math.max(delayMs, this.initialDelayMs);\n\t\t}\n\n\t\tif (delayMs > 0) {\n\t\t\tlet timer: number | undefined;\n\t\t\tlet resolveOpPromiseFn: (value: void | PromiseLike<void>) => void;\n\t\t\t// Create a listener that will break the delay if we've exceeded the initial delay ops count.\n\t\t\tconst opsListenerFn = (): void => {\n\t\t\t\tif (this.summaryCollection.opsSinceLastAck >= this.opsToBypassInitialDelay) {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\tresolveOpPromiseFn();\n\t\t\t\t}\n\t\t\t};\n\t\t\t// Create a Promise that will resolve when the delay expires.\n\t\t\tconst delayPromise = new Promise<void>((resolve) => {\n\t\t\t\ttimer = setTimeout(() => resolve(), delayMs);\n\t\t\t});\n\t\t\t// Create a Promise that will resolve if the ops count passes the threshold.\n\t\t\tconst opPromise = new Promise<void>((resolve) => {\n\t\t\t\tresolveOpPromiseFn = resolve;\n\t\t\t});\n\t\t\tthis.summaryCollection.addOpListener(opsListenerFn);\n\t\t\tawait Promise.race([delayPromise, opPromise]);\n\t\t\tthis.summaryCollection.removeOpListener(opsListenerFn);\n\t\t}\n\t\treturn startWithInitialDelay;\n\t}\n\n\tpublic summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults {\n\t\tif (this.summarizer === undefined) {\n\t\t\tthrow new Error(\"No running summarizer client\");\n\t\t\t// TODO: could spawn a summarizer client temporarily.\n\t\t}\n\t\treturn this.summarizer.summarizeOnDemand(options);\n\t}\n\n\tpublic enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult {\n\t\tif (this.summarizer === undefined) {\n\t\t\tthrow new Error(\"No running summarizer client\");\n\t\t\t// TODO: could spawn a summarizer client temporarily.\n\t\t}\n\t\treturn this.summarizer.enqueueSummarize(options);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.clientElection.off(\"electedSummarizerChanged\", this.refreshSummarizer);\n\t\tthis.connectedState.off(\"connected\", this.handleConnected);\n\t\tthis.connectedState.off(\"disconnected\", this.handleDisconnected);\n\t\tthis.cleanupForwardedEvents();\n\t\tthis.pendingStopReason = undefined;\n\t\tif (this.summarizerStopTimeout !== undefined) {\n\t\t\tclearTimeout(this.summarizerStopTimeout);\n\t\t}\n\t\tthis._disposed = true;\n\t}\n\n\tprivate readonly forwardedEventsCleanup: (() => void)[] = [];\n\n\tprivate setupForwardedEvents(summarizer: ISummarizer): void {\n\t\tfor (const event of [\n\t\t\t\"summarize\",\n\t\t\t\"summarizeAllAttemptsFailed\",\n\t\t\t\"summarizerStop\",\n\t\t\t\"summarizerStart\",\n\t\t\t\"summarizerStartupFailed\",\n\t\t\t\"summarizeTimeout\",\n\t\t] as const) {\n\t\t\tconst listener = (...args: unknown[]): void => {\n\t\t\t\tthis.emit(event, ...args);\n\t\t\t};\n\t\t\t// TODO: better typing here\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument\n\t\t\tsummarizer.on(event as any, listener);\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument\n\t\t\tthis.forwardedEventsCleanup.push(() => summarizer.off(event as any, listener));\n\t\t}\n\t}\n\n\tprivate cleanupForwardedEvents(): void {\n\t\tfor (const cleanup of this.forwardedEventsCleanup) {\n\t\t\tcleanup();\n\t\t}\n\t\tthis.forwardedEventsCleanup.length = 0;\n\t}\n}\n"]}
|
package/dist/throttler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttler.d.ts","sourceRoot":"","sources":["../src/throttler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,QAAQ,IAAI,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;CAClD;AAED;;;GAGG;AACH,qBAAa,SAAU,YAAW,UAAU;IA0B1C;;OAEG;aACa,aAAa,EAAE,MAAM;IACrC;;OAEG;aACa,UAAU,EAAE,MAAM;IAClC;;;;OAIG;aACa,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM;IAtCzD,OAAO,CAAC,UAAU,CAAgB;IAElC,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED;;;OAGG;IACI,WAAW,IAAI,SAAS,MAAM,EAAE;IAIvC;;;OAGG;IACH,IAAW,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAIjD;;IAGA;;OAEG;IACa,aAAa,EA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;;;;CAKK,KAAG,UAAU,CAAC,SAAS,CAO3B,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,kCAAkC,GAC9C,eAAe,MAAM,EACrB;;;;;CAKM,KACJ,UAAU,CAAC,SAAS,CAMpB,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GACvB;;;CAAoC,KAAG,UAAU,CAAC,SAAS,CAEZ,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,6BAA6B,GACzC,eAAe,MAAM,EACrB;;;CAAoC,KAClC,UAAU,CAAC,SAAS,CAIpB,CAAC"}
|
package/dist/throttler.js
CHANGED
|
@@ -10,6 +10,10 @@ exports.formLinearFnWithAttemptOffset = exports.formLinearFn = exports.formExpon
|
|
|
10
10
|
* Delay is based on previous attempts within specified time window, subtracting delay time.
|
|
11
11
|
*/
|
|
12
12
|
class Throttler {
|
|
13
|
+
delayWindowMs;
|
|
14
|
+
maxDelayMs;
|
|
15
|
+
delayFn;
|
|
16
|
+
startTimes = [];
|
|
13
17
|
get numAttempts() {
|
|
14
18
|
return this.startTimes.length;
|
|
15
19
|
}
|
|
@@ -47,7 +51,6 @@ class Throttler {
|
|
|
47
51
|
this.delayWindowMs = delayWindowMs;
|
|
48
52
|
this.maxDelayMs = maxDelayMs;
|
|
49
53
|
this.delayFn = delayFn;
|
|
50
|
-
this.startTimes = [];
|
|
51
54
|
}
|
|
52
55
|
getDelay() {
|
|
53
56
|
const now = Date.now();
|
package/dist/throttler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttler.js","sourceRoot":"","sources":["../src/throttler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA+BH;;;GAGG;AACH,MAAa,SAAS;
|
|
1
|
+
{"version":3,"file":"throttler.js","sourceRoot":"","sources":["../src/throttler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA+BH;;;GAGG;AACH,MAAa,SAAS;IA6BJ;IAIA;IAMA;IAtCT,UAAU,GAA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AG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC;IAC9D,MAAM;IACN,YAAY;CACZ,CAAC,CAAC;AAdS,QAAA,kCAAkC,sCAc3C;AAEJ;;;;;;GAMG;AACI,MAAM,YAAY,GACxB,CAAC,EAAE,WAAW,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,GAAG,EAAE,EAAyB,EAAE,CAChE,CAAC,WAAW,EAAE,EAAE,CACf,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,MAAM,CAAC,CAAC;AAHrC,QAAA,YAAY,gBAGyB;AAElD;;GAEG;AACI,MAAM,6BAA6B,GAAG,CAC5C,aAAqB,EACrB,EAAE,WAAW,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,GAAG,EAAE,EACZ,EAAE,CAC1B,IAAA,oBAAY,EAAC;IACZ,WAAW;IACX,MAAM,EAAE,WAAW,GAAG,aAAa,GAAG,MAAM;CAC5C,CAAC,CAAC;AAPS,QAAA,6BAA6B,iCAOtC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport interface IThrottler {\n\t/**\n\t * Computes what the throttle delay should be, and records an attempt\n\t * which will be used for calculating future attempt delays.\n\t */\n\tgetDelay(): number;\n\n\t/**\n\t * Number of attempts that occurred within the sliding window as of\n\t * the most recent delay computation.\n\t */\n\treadonly numAttempts: number;\n\n\t/**\n\t * Width of sliding delay window in milliseconds.\n\t */\n\treadonly delayWindowMs: number;\n\t/**\n\t * Maximum delay allowed in milliseconds.\n\t */\n\treadonly maxDelayMs: number;\n\t/**\n\t * Delay function used to calculate what the delay should be.\n\t * The input is the number of attempts that occurred within the sliding window.\n\t * The result is the calculated delay in milliseconds.\n\t */\n\treadonly delayFn: (numAttempts: number) => number;\n}\n\n/**\n * Used to give increasing delay times for throttling a single functionality.\n * Delay is based on previous attempts within specified time window, subtracting delay time.\n */\nexport class Throttler implements IThrottler {\n\tprivate startTimes: number[] = [];\n\n\tpublic get numAttempts(): number {\n\t\treturn this.startTimes.length;\n\t}\n\n\t/**\n\t * Gets all attempt start times after compensating for the delay times\n\t * by adding the delay times to the actual times.\n\t */\n\tpublic getAttempts(): readonly number[] {\n\t\treturn [...this.startTimes];\n\t}\n\n\t/**\n\t * Latest attempt time after compensating for the delay time itself\n\t * by adding the delay time to the actual time.\n\t */\n\tpublic get latestAttemptTime(): number | undefined {\n\t\treturn this.startTimes.length > 0\n\t\t\t? this.startTimes[this.startTimes.length - 1]\n\t\t\t: undefined;\n\t}\n\n\tconstructor(\n\t\t/**\n\t\t * Width of sliding delay window in milliseconds.\n\t\t */\n\t\tpublic readonly delayWindowMs: number,\n\t\t/**\n\t\t * Maximum delay allowed in milliseconds.\n\t\t */\n\t\tpublic readonly maxDelayMs: number,\n\t\t/**\n\t\t * Delay function used to calculate what the delay should be.\n\t\t * The input is the number of attempts that occurred within the sliding window.\n\t\t * The result is the calculated delay in milliseconds.\n\t\t */\n\t\tpublic readonly delayFn: (numAttempts: number) => number,\n\t) {}\n\n\tpublic getDelay(): number {\n\t\tconst now = Date.now();\n\n\t\tconst latestAttemptTime = this.latestAttemptTime;\n\t\tif (latestAttemptTime !== undefined) {\n\t\t\t// If getDelay was called sooner than the most recent delay,\n\t\t\t// subtract the remaining time, since we previously added it.\n\t\t\tconst earlyMs = latestAttemptTime - now;\n\t\t\tif (earlyMs > 0) {\n\t\t\t\tthis.startTimes = this.startTimes.map((t) => t - earlyMs);\n\t\t\t}\n\t\t}\n\n\t\t// Remove all attempts that have already fallen out of the window.\n\t\tthis.startTimes = this.startTimes.filter((t) => now - t < this.delayWindowMs);\n\n\t\t// Compute delay, but do not exceed the specified max delay.\n\t\tconst delayMs = Math.min(this.delayFn(this.startTimes.length), this.maxDelayMs);\n\n\t\t// Record this attempt start time.\n\t\tthis.startTimes.push(now);\n\n\t\t// Account for the delay time, by effectively removing it from the delay window.\n\t\tthis.startTimes = this.startTimes.map((t) => t + delayMs);\n\n\t\tif (delayMs === this.maxDelayMs) {\n\t\t\t// We hit max delay, so adding more won't affect anything.\n\t\t\t// Shift off oldest time to stop this array from growing forever.\n\t\t\tthis.startTimes.shift();\n\t\t}\n\n\t\treturn delayMs;\n\t}\n}\n\n/**\n * Helper function to generate simple exponential throttle functions.\n * f(n) = [coefficient] x ([multiplier]^n) + [flatOffset]\n * where n = number of attempts, and f(n) = delay time in milliseconds.\n * If not provided, coefficient will default to 1, multiplier to 2,\n * minimum delay to 0, and the offset to 0, yielding:\n * 0 ms, 2 ms, 4 ms, 8 ms, ..., 2^n ms\n * where M = multiplier; an exponential back-off.\n * Use initialDelay to decide what should happen when numAttempts is 0,\n * leave it undefined to not special case.\n */\nexport const formExponentialFn =\n\t({\n\t\tmultiplier = 2,\n\t\tcoefficient = 1,\n\t\toffset = 0,\n\t\tinitialDelay = undefined as number | undefined,\n\t} = {}): IThrottler[\"delayFn\"] =>\n\t(numAttempts) =>\n\t\tMath.max(\n\t\t\t0,\n\t\t\tnumAttempts <= 0 && initialDelay !== undefined\n\t\t\t\t? initialDelay\n\t\t\t\t: coefficient * Math.pow(multiplier, numAttempts) + offset,\n\t\t);\n\n/**\n * f(n) = C x (B^(n+A)) + F = (C x B^A) x B^n + F\n */\nexport const formExponentialFnWithAttemptOffset = (\n\tattemptOffset: number,\n\t{\n\t\tmultiplier = 2,\n\t\tcoefficient = 1,\n\t\toffset = 0,\n\t\tinitialDelay = undefined as number | undefined,\n\t} = {},\n): IThrottler[\"delayFn\"] =>\n\tformExponentialFn({\n\t\tmultiplier,\n\t\tcoefficient: coefficient * Math.pow(multiplier, attemptOffset),\n\t\toffset,\n\t\tinitialDelay,\n\t});\n\n/**\n * Helper function to generate simple linear throttle functions.\n * f(n) = [coefficient] x n + [flatOffset]\n * where n = number of attempts, and f(n) = delay time in milliseconds.\n * If not provided, coefficient will default to 1, and offset to 0, yielding:\n * 0 ms, 1 ms, 2 ms, 3 ms, ..., n ms delays; a linear back-off.\n */\nexport const formLinearFn =\n\t({ coefficient = 1, offset = 0 } = {}): IThrottler[\"delayFn\"] =>\n\t(numAttempts) =>\n\t\tMath.max(0, coefficient * numAttempts + offset);\n\n/**\n * f(n) = C x (n+A) + F = C x n + (C x A + F)\n */\nexport const formLinearFnWithAttemptOffset = (\n\tattemptOffset: number,\n\t{ coefficient = 1, offset = 0 } = {},\n): IThrottler[\"delayFn\"] =>\n\tformLinearFn({\n\t\tcoefficient,\n\t\toffset: coefficient * attemptOffset + offset,\n\t});\n"]}
|
|
@@ -10,12 +10,14 @@ import { type InboundMessageResult } from "../opLifecycle/index.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export interface InboundVersionMarkUpdate {
|
|
12
12
|
/**
|
|
13
|
-
* A completed batch to record via `processInboundBatch`: its id and its last op's sequence
|
|
14
|
-
* Undefined when no batch completed on this message (a piecemeal batch
|
|
13
|
+
* A completed batch to record via `processInboundBatch`: its id and its last op's sequence
|
|
14
|
+
* number and timestamp. Undefined when no batch completed on this message (a piecemeal batch
|
|
15
|
+
* still in progress).
|
|
15
16
|
*/
|
|
16
17
|
readonly sequenced?: {
|
|
17
18
|
readonly batchId: string;
|
|
18
19
|
readonly sequenceNumber: number;
|
|
20
|
+
readonly timestamp: number;
|
|
19
21
|
};
|
|
20
22
|
/**
|
|
21
23
|
* The batch id to carry for a piecemeal batch still in progress, or undefined when none is pending.
|
|
@@ -25,10 +27,10 @@ export interface InboundVersionMarkUpdate {
|
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* Maps an inbound batch result to the version-mark resolver update. A batch's resolved point is its last
|
|
28
|
-
* op's sequence number, so this reports `(batchId, sequenceNumber)` only once a
|
|
29
|
-
* both a batch delivered whole (`fullBatch`, incl. an empty grouped batch via
|
|
30
|
-
* and one delivered piecemeal (`batchStartingMessage` then `nextBatchMessage`
|
|
31
|
-
* batch id across the piecemeal messages via `carriedBatchId`.
|
|
30
|
+
* op's sequence number and timestamp, so this reports `(batchId, sequenceNumber, timestamp)` only once a
|
|
31
|
+
* batch completes. It handles both a batch delivered whole (`fullBatch`, incl. an empty grouped batch via
|
|
32
|
+
* the batch-start key message) and one delivered piecemeal (`batchStartingMessage` then `nextBatchMessage`
|
|
33
|
+
* with `batchEnd`), carrying the batch id across the piecemeal messages via `carriedBatchId`.
|
|
32
34
|
*
|
|
33
35
|
* @internal
|
|
34
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inboundBatch.d.ts","sourceRoot":"","sources":["../../src/versionMarks/inboundBatch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAuB,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEzF;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACxC
|
|
1
|
+
{"version":3,"file":"inboundBatch.d.ts","sourceRoot":"","sources":["../../src/versionMarks/inboundBatch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAuB,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEzF;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE;QACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;QAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACvC,aAAa,EAAE,oBAAoB,EACnC,cAAc,EAAE,MAAM,GAAG,SAAS,GAChC,wBAAwB,CAqC1B"}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.inboundVersionMarkUpdate =
|
|
7
|
+
exports.inboundVersionMarkUpdate = inboundVersionMarkUpdate;
|
|
8
8
|
const index_js_1 = require("../opLifecycle/index.js");
|
|
9
9
|
/**
|
|
10
10
|
* Maps an inbound batch result to the version-mark resolver update. A batch's resolved point is its last
|
|
11
|
-
* op's sequence number, so this reports `(batchId, sequenceNumber)` only once a
|
|
12
|
-
* both a batch delivered whole (`fullBatch`, incl. an empty grouped batch via
|
|
13
|
-
* and one delivered piecemeal (`batchStartingMessage` then `nextBatchMessage`
|
|
14
|
-
* batch id across the piecemeal messages via `carriedBatchId`.
|
|
11
|
+
* op's sequence number and timestamp, so this reports `(batchId, sequenceNumber, timestamp)` only once a
|
|
12
|
+
* batch completes. It handles both a batch delivered whole (`fullBatch`, incl. an empty grouped batch via
|
|
13
|
+
* the batch-start key message) and one delivered piecemeal (`batchStartingMessage` then `nextBatchMessage`
|
|
14
|
+
* with `batchEnd`), carrying the batch id across the piecemeal messages via `carriedBatchId`.
|
|
15
15
|
*
|
|
16
16
|
* @internal
|
|
17
17
|
*/
|
|
@@ -25,7 +25,11 @@ function inboundVersionMarkUpdate(inboundResult, carriedBatchId) {
|
|
|
25
25
|
inboundResult.messages[inboundResult.messages.length - 1] ??
|
|
26
26
|
inboundResult.batchStart.keyMessage;
|
|
27
27
|
return {
|
|
28
|
-
sequenced: {
|
|
28
|
+
sequenced: {
|
|
29
|
+
batchId,
|
|
30
|
+
sequenceNumber: lastMessage.sequenceNumber,
|
|
31
|
+
timestamp: lastMessage.timestamp,
|
|
32
|
+
},
|
|
29
33
|
carriedBatchId: undefined,
|
|
30
34
|
};
|
|
31
35
|
}
|
|
@@ -39,6 +43,7 @@ function inboundVersionMarkUpdate(inboundResult, carriedBatchId) {
|
|
|
39
43
|
sequenced: {
|
|
40
44
|
batchId: carriedBatchId,
|
|
41
45
|
sequenceNumber: inboundResult.nextMessage.sequenceNumber,
|
|
46
|
+
timestamp: inboundResult.nextMessage.timestamp,
|
|
42
47
|
},
|
|
43
48
|
carriedBatchId: undefined,
|
|
44
49
|
};
|
|
@@ -46,5 +51,4 @@ function inboundVersionMarkUpdate(inboundResult, carriedBatchId) {
|
|
|
46
51
|
// A mid-batch message, or a batch end with no carried id: no change.
|
|
47
52
|
return { carriedBatchId };
|
|
48
53
|
}
|
|
49
|
-
exports.inboundVersionMarkUpdate = inboundVersionMarkUpdate;
|
|
50
54
|
//# sourceMappingURL=inboundBatch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inboundBatch.js","sourceRoot":"","sources":["../../src/versionMarks/inboundBatch.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"inboundBatch.js","sourceRoot":"","sources":["../../src/versionMarks/inboundBatch.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAoCH,4DAwCC;AA1ED,sDAAyF;AAyBzF;;;;;;;;GAQG;AACH,SAAgB,wBAAwB,CACvC,aAAmC,EACnC,cAAkC;IAElC,IAAI,YAAY,IAAI,aAAa,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,IAAA,8BAAmB,EAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC9D,IAAI,aAAa,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YACxC,uGAAuG;YACvG,MAAM,WAAW;YAChB,uGAAuG;YACvG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;gBACzD,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC;YACrC,OAAO;gBACN,SAAS,EAAE;oBACV,OAAO;oBACP,cAAc,EAAE,WAAW,CAAC,cAAc;oBAC1C,SAAS,EAAE,WAAW,CAAC,SAAS;iBAChC;gBACD,cAAc,EAAE,SAAS;aACzB,CAAC;QACH,CAAC;QACD,4EAA4E;QAC5E,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC;IACpC,CAAC;IACD,IACC,aAAa,CAAC,IAAI,KAAK,kBAAkB;QACzC,aAAa,CAAC,QAAQ,KAAK,IAAI;QAC/B,cAAc,KAAK,SAAS,EAC3B,CAAC;QACF,OAAO;YACN,SAAS,EAAE;gBACV,OAAO,EAAE,cAAc;gBACvB,cAAc,EAAE,aAAa,CAAC,WAAW,CAAC,cAAc;gBACxD,SAAS,EAAE,aAAa,CAAC,WAAW,CAAC,SAAS;aAC9C;YACD,cAAc,EAAE,SAAS;SACzB,CAAC;IACH,CAAC;IACD,qEAAqE;IACrE,OAAO,EAAE,cAAc,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { getEffectiveBatchId, type InboundMessageResult } from \"../opLifecycle/index.js\";\n\n/**\n * The version-mark resolver update derived from an inbound batch result.\n *\n * @internal\n */\nexport interface InboundVersionMarkUpdate {\n\t/**\n\t * A completed batch to record via `processInboundBatch`: its id and its last op's sequence\n\t * number and timestamp. Undefined when no batch completed on this message (a piecemeal batch\n\t * still in progress).\n\t */\n\treadonly sequenced?: {\n\t\treadonly batchId: string;\n\t\treadonly sequenceNumber: number;\n\t\treadonly timestamp: number;\n\t};\n\t/**\n\t * The batch id to carry for a piecemeal batch still in progress, or undefined when none is pending.\n\t * The caller stores this and passes it back on the next inbound result.\n\t */\n\treadonly carriedBatchId: string | undefined;\n}\n\n/**\n * Maps an inbound batch result to the version-mark resolver update. A batch's resolved point is its last\n * op's sequence number and timestamp, so this reports `(batchId, sequenceNumber, timestamp)` only once a\n * batch completes. It handles both a batch delivered whole (`fullBatch`, incl. an empty grouped batch via\n * the batch-start key message) and one delivered piecemeal (`batchStartingMessage` then `nextBatchMessage`\n * with `batchEnd`), carrying the batch id across the piecemeal messages via `carriedBatchId`.\n *\n * @internal\n */\nexport function inboundVersionMarkUpdate(\n\tinboundResult: InboundMessageResult,\n\tcarriedBatchId: string | undefined,\n): InboundVersionMarkUpdate {\n\tif (\"batchStart\" in inboundResult) {\n\t\tconst batchId = getEffectiveBatchId(inboundResult.batchStart);\n\t\tif (inboundResult.type === \"fullBatch\") {\n\t\t\t// The last op is the batch's resolved point; an empty batch falls back to the batch-start key message.\n\t\t\tconst lastMessage =\n\t\t\t\t// eslint-disable-next-line unicorn/prefer-at -- Array.prototype.at is not in this package's lib target\n\t\t\t\tinboundResult.messages[inboundResult.messages.length - 1] ??\n\t\t\t\tinboundResult.batchStart.keyMessage;\n\t\t\treturn {\n\t\t\t\tsequenced: {\n\t\t\t\t\tbatchId,\n\t\t\t\t\tsequenceNumber: lastMessage.sequenceNumber,\n\t\t\t\t\ttimestamp: lastMessage.timestamp,\n\t\t\t\t},\n\t\t\t\tcarriedBatchId: undefined,\n\t\t\t};\n\t\t}\n\t\t// batchStartingMessage: carry the id until the batch's end message arrives.\n\t\treturn { carriedBatchId: batchId };\n\t}\n\tif (\n\t\tinboundResult.type === \"nextBatchMessage\" &&\n\t\tinboundResult.batchEnd === true &&\n\t\tcarriedBatchId !== undefined\n\t) {\n\t\treturn {\n\t\t\tsequenced: {\n\t\t\t\tbatchId: carriedBatchId,\n\t\t\t\tsequenceNumber: inboundResult.nextMessage.sequenceNumber,\n\t\t\t\ttimestamp: inboundResult.nextMessage.timestamp,\n\t\t\t},\n\t\t\tcarriedBatchId: undefined,\n\t\t};\n\t}\n\t// A mid-batch message, or a batch end with no carried id: no change.\n\treturn { carriedBatchId };\n}\n"]}
|
|
@@ -15,13 +15,15 @@ export interface IHistoricalOpReader {
|
|
|
15
15
|
fetchMessages(from: number, to?: number, abortSignal?: AbortSignal): Promise<IStream<ISequencedDocumentMessage[]>>;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* Result of resolving a pending batchId.
|
|
18
|
+
* Result of resolving a pending batchId. A resolved result includes the matched batch's last op server
|
|
19
|
+
* timestamp when available. The property is optional for compatibility with previously stored results.
|
|
19
20
|
*
|
|
20
21
|
* @legacy @beta
|
|
21
22
|
*/
|
|
22
23
|
export type ResolveResult = {
|
|
23
24
|
readonly kind: "resolved";
|
|
24
25
|
readonly sequenceNumber: number;
|
|
26
|
+
readonly timestamp?: number;
|
|
25
27
|
} | {
|
|
26
28
|
readonly kind: "pending";
|
|
27
29
|
} | {
|
|
@@ -42,6 +44,7 @@ export type VersionMarkCapture = {
|
|
|
42
44
|
} | {
|
|
43
45
|
readonly kind: "resolved";
|
|
44
46
|
readonly sequenceNumber: number;
|
|
47
|
+
readonly timestamp?: number;
|
|
45
48
|
};
|
|
46
49
|
/**
|
|
47
50
|
* Runtime-owned resolver for app-stored version mark locators.
|
|
@@ -53,40 +56,45 @@ export interface IVersionMarkResolver {
|
|
|
53
56
|
* Captures a version mark at the current point. Seals the current outbound batch first (so a just-made
|
|
54
57
|
* local edit has a stable `batchId`, which is only assigned when a batch is flushed), then returns the
|
|
55
58
|
* mark data atomically: a `pending` capture (`batchId` + `sequenceNumberLowerBound`) when there is an
|
|
56
|
-
* unacked local batch, or a `resolved` capture (`sequenceNumber`
|
|
59
|
+
* unacked local batch, or a `resolved` capture (`sequenceNumber` + the last processed op's server
|
|
60
|
+
* `timestamp`) when there is no in-flight local work. The timestamp property is optional both for
|
|
61
|
+
* compatibility with previously stored captures and because it is `undefined` when neither a last
|
|
62
|
+
* processed message nor a last-summary message is available.
|
|
57
63
|
*
|
|
58
64
|
* @remarks Sealing the batch is a side effect (it submits the current batch), so capture at savepoint
|
|
59
65
|
* boundaries, not per keystroke.
|
|
60
66
|
*
|
|
61
|
-
* @returns The pending batch identity and
|
|
62
|
-
* when there is no pending local batch.
|
|
67
|
+
* @returns The pending batch identity and inclusive sequence number lower bound, or the current sequence
|
|
68
|
+
* number and corresponding op timestamp (when available) when there is no pending local batch.
|
|
63
69
|
*/
|
|
64
70
|
sealAndCaptureVersionMark(): VersionMarkCapture;
|
|
65
71
|
/**
|
|
66
72
|
* Resolves a pending mark's batchId to a global sequence number (`sequenceNumberLowerBound` is the
|
|
67
|
-
*
|
|
73
|
+
* inclusive lower bound for a history read). A `resolved` sequence number feeds the loader's
|
|
68
74
|
* `loadContainerToSequenceNumber`.
|
|
69
75
|
*
|
|
70
76
|
* @param batchId - The stable identity of the pending batch.
|
|
71
|
-
* @param sequenceNumberLowerBound - The
|
|
72
|
-
* @returns The resolved sequence number, or a result indicating that the batch
|
|
73
|
-
* no longer be resolved.
|
|
77
|
+
* @param sequenceNumberLowerBound - The inclusive lower bound for the historical op search.
|
|
78
|
+
* @returns The resolved sequence number and server timestamp, or a result indicating that the batch
|
|
79
|
+
* remains pending or can no longer be resolved.
|
|
74
80
|
*/
|
|
75
81
|
resolve(batchId: string, sequenceNumberLowerBound: number): Promise<ResolveResult>;
|
|
76
82
|
/**
|
|
77
|
-
* Subscribes to inbound batch sequencing: fires `(batchId, sequenceNumber)` per batch so any
|
|
78
|
-
* client can promote a matching pending mark. Returns an unsubscribe function.
|
|
83
|
+
* Subscribes to inbound batch sequencing: fires `(batchId, sequenceNumber, timestamp)` per batch so any
|
|
84
|
+
* connected client can promote a matching pending mark. Returns an unsubscribe function.
|
|
79
85
|
*
|
|
80
|
-
* @param listener - Called with the stable batch identity
|
|
86
|
+
* @param listener - Called with the stable batch identity, its final sequence number, and the final op's
|
|
87
|
+
* server timestamp.
|
|
81
88
|
* @returns A function that unsubscribes the listener.
|
|
82
89
|
*/
|
|
83
|
-
onBatchSequenced(listener: (batchId: string, sequenceNumber: number) => void): () => void;
|
|
90
|
+
onBatchSequenced(listener: (batchId: string, sequenceNumber: number, timestamp?: number) => void): () => void;
|
|
84
91
|
}
|
|
85
92
|
/**
|
|
86
93
|
* @internal
|
|
87
94
|
*/
|
|
88
95
|
export interface VersionMarkResolverRuntimeHooks {
|
|
89
96
|
readonly getCurrentSequenceNumber: () => number;
|
|
97
|
+
readonly getCurrentTimestamp: () => number | undefined;
|
|
90
98
|
readonly getCurrentMinimumSequenceNumber: () => number;
|
|
91
99
|
readonly getCurrentPendingBatchId: () => string | undefined;
|
|
92
100
|
/** Logs faults from app-supplied `onBatchSequenced` listeners (see {@link VersionMarkResolver.processInboundBatch}). */
|
|
@@ -118,7 +126,7 @@ export interface VersionMarkResolverRuntimeHooks {
|
|
|
118
126
|
*/
|
|
119
127
|
export declare class VersionMarkResolver implements IVersionMarkResolver {
|
|
120
128
|
private readonly hooks;
|
|
121
|
-
private readonly
|
|
129
|
+
private readonly resolvedBatchById;
|
|
122
130
|
private readonly batchListeners;
|
|
123
131
|
/**
|
|
124
132
|
* Sticky flag: false until the feature is first used this session (a pending capture or a listener).
|
|
@@ -132,25 +140,24 @@ export declare class VersionMarkResolver implements IVersionMarkResolver {
|
|
|
132
140
|
sealAndCaptureVersionMark(): VersionMarkCapture;
|
|
133
141
|
resolve(batchId: string, sequenceNumberLowerBound: number): Promise<ResolveResult>;
|
|
134
142
|
/**
|
|
135
|
-
* Scans sequenced ops
|
|
143
|
+
* Scans sequenced ops from `sequenceNumberLowerBound` (inclusive) for `batchId`, returning its last op's
|
|
136
144
|
* sequence number when found and aborting the fetch once found or exhausted. Each op is routed through
|
|
137
145
|
* the same unpack pipeline the live inbound path uses (chunk reassembly, ungroup, decompress) and
|
|
138
|
-
* {@link inboundVersionMarkUpdate} derives its batch identity, so
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* See DEV.md.
|
|
146
|
+
* {@link inboundVersionMarkUpdate} derives its batch identity, so virtualized batches resolve here too.
|
|
147
|
+
* The injected historical unpacker owns virtualization details, including tolerating a requested range
|
|
148
|
+
* that begins within an incomplete chunk stream. On a miss, {@link classifyMiss} distinguishes
|
|
149
|
+
* `pending` (not sequenced yet) from `unresolvable` (ops trimmed).
|
|
143
150
|
*/
|
|
144
151
|
private resolveFromHistory;
|
|
145
152
|
/**
|
|
146
153
|
* Classifies a history-scan miss as `pending` or `unresolvable`. See {@link resolveFromHistory}.
|
|
147
154
|
*/
|
|
148
155
|
private classifyMiss;
|
|
149
|
-
onBatchSequenced(listener: (batchId: string, sequenceNumber: number) => void): () => void;
|
|
150
|
-
/** The
|
|
151
|
-
private
|
|
156
|
+
onBatchSequenced(listener: (batchId: string, sequenceNumber: number, timestamp?: number) => void): () => void;
|
|
157
|
+
/** The resolved point for a batch seen live this session, or undefined. */
|
|
158
|
+
private sessionResolutionFor;
|
|
152
159
|
/** Records an inbound batch and notifies listeners so any client can promote matching pending marks. */
|
|
153
|
-
processInboundBatch(batchId: string, sequenceNumber: number): void;
|
|
160
|
+
processInboundBatch(batchId: string, sequenceNumber: number, timestamp: number): void;
|
|
154
161
|
/**
|
|
155
162
|
* Bounds the map to the collaboration window by dropping entries below the MSN (mirrors
|
|
156
163
|
* `DuplicateBatchDetector`). Safe because below the MSN every client has processed the batch, so its
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionMarkResolver.d.ts","sourceRoot":"","sources":["../../src/versionMarks/versionMarkResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,yBAAyB,EACzB,OAAO,EACP,MAAM,6CAA6C,CAAC;AAGrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAEnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"versionMarkResolver.d.ts","sourceRoot":"","sources":["../../src/versionMarks/versionMarkResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,yBAAyB,EACzB,OAAO,EACP,MAAM,6CAA6C,CAAC;AAGrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAEnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAIpE;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IACnC,aAAa,CACZ,IAAI,EAAE,MAAM,EACZ,EAAE,CAAC,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,WAAW,GACvB,OAAO,CAAC,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC;CAC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