diff --git a/packages/runtime/container-runtime/src/containerRuntime.ts b/packages/runtime/container-runtime/src/containerRuntime.ts index 4eb755705233..432c7938b886 100644 --- a/packages/runtime/container-runtime/src/containerRuntime.ts +++ b/packages/runtime/container-runtime/src/containerRuntime.ts @@ -3700,7 +3700,7 @@ export class ContainerRuntime throw error; } - await this.closeStaleSummarizer(); + await this.closeStaleSummarizer("RefreshLatestSummaryAckFetch"); return; } @@ -3727,12 +3727,22 @@ export class ContainerRuntime null, ); - await this.closeStaleSummarizer(); + await this.closeStaleSummarizer("RefreshLatestSummaryFromServerFetch"); return { latestSnapshotRefSeq, latestSnapshotVersionId: versionId }; } - private async closeStaleSummarizer(): Promise { + private async closeStaleSummarizer(codePath: string): Promise { + this.mc.logger.sendTelemetryEvent( + { + eventName: "ClosingSummarizerOnSummaryStale", + codePath, + message: "Stopping fetch from storage", + closeSummarizerDelayMs: this.closeSummarizerDelayMs, + }, + new GenericError("Restarting summarizer instead of refreshing"), + ); + // Delay before restarting summarizer to prevent the summarizer from restarting too frequently. await delay(this.closeSummarizerDelayMs); this._summarizer?.stop("latestSummaryStateStale"); diff --git a/packages/test/test-end-to-end-tests/src/test/summarizeRestart.spec.ts b/packages/test/test-end-to-end-tests/src/test/summarizeRestart.spec.ts index 537e0d76a79e..12c15fbf4852 100644 --- a/packages/test/test-end-to-end-tests/src/test/summarizeRestart.spec.ts +++ b/packages/test/test-end-to-end-tests/src/test/summarizeRestart.spec.ts @@ -47,6 +47,9 @@ describeNoCompat("Summarizer closes instead of refreshing", (getTestObjectProvid eventName: "fluid:telemetry:Summarizer:Running:RefreshLatestSummaryFromServerFetch_end", }, + { + eventName: "fluid:telemetry:ContainerRuntime:ClosingSummarizerOnSummaryStale", + }, { eventName: "fluid:telemetry:Container:ContainerDispose", category: "generic", @@ -82,6 +85,9 @@ describeNoCompat("Summarizer closes instead of refreshing", (getTestObjectProvid { eventName: "fluid:telemetry:SummarizerNode:refreshLatestSummary_end", }, + { + eventName: "fluid:telemetry:ContainerRuntime:ClosingSummarizerOnSummaryStale", + }, { eventName: "fluid:telemetry:Container:ContainerDispose", category: "generic", @@ -117,6 +123,9 @@ describeNoCompat("Summarizer closes instead of refreshing", (getTestObjectProvid itExpects( "Closes the summarizing client instead of refreshing when loading from an older summary", [ + { + eventName: "fluid:telemetry:ContainerRuntime:ClosingSummarizerOnSummaryStale", + }, { eventName: "fluid:telemetry:Container:ContainerDispose", category: "generic", @@ -169,6 +178,9 @@ describeNoCompat("Summarizer closes instead of refreshing", (getTestObjectProvid eventName: "fluid:telemetry:Summarizer:Running:RefreshLatestSummaryFromServerFetch_end", }, + { + eventName: "fluid:telemetry:ContainerRuntime:ClosingSummarizerOnSummaryStale", + }, { eventName: "fluid:telemetry:Container:ContainerDispose", category: "generic",