Skip to content

Commit

Permalink
Add back closingSummarizerOnSummaryStale
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-cai-microsoft committed Aug 30, 2023
1 parent fb7dfb3 commit 0c15d64
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/runtime/container-runtime/src/containerRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3700,7 +3700,7 @@ export class ContainerRuntime
throw error;
}

await this.closeStaleSummarizer();
await this.closeStaleSummarizer("RefreshLatestSummaryAckFetch");
return;
}

Expand All @@ -3727,12 +3727,22 @@ export class ContainerRuntime
null,
);

await this.closeStaleSummarizer();
await this.closeStaleSummarizer("RefreshLatestSummaryFromServerFetch");

return { latestSnapshotRefSeq, latestSnapshotVersionId: versionId };
}

private async closeStaleSummarizer(): Promise<void> {
private async closeStaleSummarizer(codePath: string): Promise<void> {
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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 0c15d64

Please sign in to comment.