@fluidframework/container-runtime 2.0.0-internal.1.4.4 → 2.0.0-internal.2.0.1
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/dist/batchManager.d.ts +2 -3
- package/dist/batchManager.d.ts.map +1 -1
- package/dist/batchManager.js +3 -8
- package/dist/batchManager.js.map +1 -1
- package/dist/containerRuntime.d.ts +43 -16
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +107 -82
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +4 -20
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +17 -47
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +2 -5
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +3 -11
- package/dist/dataStores.js.map +1 -1
- package/dist/garbageCollection.d.ts +1 -10
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +43 -51
- package/dist/garbageCollection.js.map +1 -1
- package/dist/gcSweepReadyUsageDetection.d.ts.map +1 -1
- package/dist/gcSweepReadyUsageDetection.js +3 -12
- package/dist/gcSweepReadyUsageDetection.js.map +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +6 -26
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +42 -62
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summarizer.js +7 -2
- package/dist/summarizer.js.map +1 -1
- package/dist/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summarizerHeuristics.js +0 -3
- package/dist/summarizerHeuristics.js.map +1 -1
- package/dist/summarizerTypes.d.ts +19 -2
- package/dist/summarizerTypes.d.ts.map +1 -1
- package/dist/summarizerTypes.js.map +1 -1
- package/dist/summaryFormat.d.ts +4 -2
- package/dist/summaryFormat.d.ts.map +1 -1
- package/dist/summaryFormat.js.map +1 -1
- package/dist/summaryManager.d.ts.map +1 -1
- package/dist/summaryManager.js +10 -6
- package/dist/summaryManager.js.map +1 -1
- package/lib/batchManager.d.ts +2 -3
- package/lib/batchManager.d.ts.map +1 -1
- package/lib/batchManager.js +3 -8
- package/lib/batchManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +43 -16
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +108 -83
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +4 -20
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +18 -48
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +2 -5
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +3 -11
- package/lib/dataStores.js.map +1 -1
- package/lib/garbageCollection.d.ts +1 -10
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +42 -50
- package/lib/garbageCollection.js.map +1 -1
- package/lib/gcSweepReadyUsageDetection.d.ts.map +1 -1
- package/lib/gcSweepReadyUsageDetection.js +3 -12
- package/lib/gcSweepReadyUsageDetection.js.map +1 -1
- package/lib/index.d.ts +3 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +6 -26
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +42 -62
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summarizer.js +7 -2
- package/lib/summarizer.js.map +1 -1
- package/lib/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summarizerHeuristics.js +0 -3
- package/lib/summarizerHeuristics.js.map +1 -1
- package/lib/summarizerTypes.d.ts +19 -2
- package/lib/summarizerTypes.d.ts.map +1 -1
- package/lib/summarizerTypes.js.map +1 -1
- package/lib/summaryFormat.d.ts +4 -2
- package/lib/summaryFormat.d.ts.map +1 -1
- package/lib/summaryFormat.js.map +1 -1
- package/lib/summaryManager.d.ts.map +1 -1
- package/lib/summaryManager.js +10 -6
- package/lib/summaryManager.js.map +1 -1
- package/package.json +22 -65
- package/src/batchManager.ts +7 -11
- package/src/containerRuntime.ts +149 -100
- package/src/dataStoreContext.ts +20 -62
- package/src/dataStores.ts +2 -10
- package/src/garbageCollection.ts +45 -55
- package/src/gcSweepReadyUsageDetection.ts +2 -10
- package/src/index.ts +2 -3
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +57 -96
- package/src/scheduleManager.ts +1 -0
- package/src/summarizer.ts +6 -6
- package/src/summarizerHeuristics.ts +0 -3
- package/src/summarizerTypes.ts +20 -7
- package/src/summaryFormat.ts +4 -2
- package/src/summaryManager.ts +18 -7
package/src/summarizer.ts
CHANGED
|
@@ -334,7 +334,7 @@ export class Summarizer extends EventEmitter implements ISummarizer {
|
|
|
334
334
|
const coordinatorCreateP = this.runCoordinatorCreateFn(this.runtime);
|
|
335
335
|
|
|
336
336
|
coordinatorCreateP.then((runCoordinator) => {
|
|
337
|
-
//
|
|
337
|
+
// Successfully created the cancellation token. Start the summarizer.
|
|
338
338
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
339
339
|
const startP = this.start(this.runtime.clientId!, runCoordinator);
|
|
340
340
|
startP.then(async (runningSummarizer) => {
|
|
@@ -382,11 +382,11 @@ export class Summarizer extends EventEmitter implements ISummarizer {
|
|
|
382
382
|
// executing the refreshLatestSummaryAck.
|
|
383
383
|
// https://dev.azure.com/fluidframework/internal/_workitems/edit/779
|
|
384
384
|
await this.runningSummarizer.lockedRefreshSummaryAckAction(async () =>
|
|
385
|
-
this.internalsProvider.refreshLatestSummaryAck(
|
|
386
|
-
summaryOpHandle,
|
|
387
|
-
summaryAckHandle,
|
|
388
|
-
refSequenceNumber,
|
|
389
|
-
summaryLogger,
|
|
385
|
+
this.internalsProvider.refreshLatestSummaryAck({
|
|
386
|
+
proposalHandle: summaryOpHandle,
|
|
387
|
+
ackHandle: summaryAckHandle,
|
|
388
|
+
summaryRefSeq: refSequenceNumber,
|
|
389
|
+
summaryLogger },
|
|
390
390
|
).catch(async (error) => {
|
|
391
391
|
// If the error is 404, so maybe the fetched version no longer exists on server. We just
|
|
392
392
|
// ignore this error in that case, as that means we will have another summaryAck for the
|
|
@@ -119,9 +119,6 @@ export class SummarizeHeuristicRunner implements ISummarizeHeuristicRunner {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
public get idleTime(): number {
|
|
122
|
-
if (this.configuration.idleTime !== undefined) {
|
|
123
|
-
return this.configuration.idleTime;
|
|
124
|
-
}
|
|
125
122
|
const maxIdleTime = this.configuration.maxIdleTime;
|
|
126
123
|
const minIdleTime = this.configuration.minIdleTime;
|
|
127
124
|
const weightedNumOfOps = getWeightedNumberOfOps(
|
package/src/summarizerTypes.ts
CHANGED
|
@@ -61,12 +61,7 @@ export interface ISummarizerInternalsProvider {
|
|
|
61
61
|
submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
|
|
62
62
|
|
|
63
63
|
/** Callback whenever a new SummaryAck is received, to update internal tracking state */
|
|
64
|
-
refreshLatestSummaryAck(
|
|
65
|
-
proposalHandle: string,
|
|
66
|
-
ackHandle: string,
|
|
67
|
-
summaryRefSeq: number,
|
|
68
|
-
summaryLogger: ITelemetryLogger,
|
|
69
|
-
): Promise<void>;
|
|
64
|
+
refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;
|
|
70
65
|
}
|
|
71
66
|
|
|
72
67
|
/**
|
|
@@ -114,6 +109,20 @@ export interface ISummarizeOptions {
|
|
|
114
109
|
readonly refreshLatestAck?: boolean;
|
|
115
110
|
}
|
|
116
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Data required to update internal tracking state after receiving a Summary Ack.
|
|
114
|
+
*/
|
|
115
|
+
export interface IRefreshSummaryAckOptions {
|
|
116
|
+
/** Handle from the ack's summary op. */
|
|
117
|
+
readonly proposalHandle: string | undefined;
|
|
118
|
+
/** Handle from the summary ack just received */
|
|
119
|
+
readonly ackHandle: string;
|
|
120
|
+
/** Reference sequence number from the ack's summary op */
|
|
121
|
+
readonly summaryRefSeq: number;
|
|
122
|
+
/** Telemetry logger to which telemetry events will be forwarded. */
|
|
123
|
+
readonly summaryLogger: ITelemetryLogger;
|
|
124
|
+
}
|
|
125
|
+
|
|
117
126
|
export interface ISubmitSummaryOptions extends ISummarizeOptions {
|
|
118
127
|
/** Logger to use for correlated summary events */
|
|
119
128
|
readonly summaryLogger: ITelemetryLogger;
|
|
@@ -292,7 +301,11 @@ export type SummarizerStopReason =
|
|
|
292
301
|
* client to no longer be elected as responsible for summaries. Then it
|
|
293
302
|
* tries to stop its spawned summarizer client.
|
|
294
303
|
*/
|
|
295
|
-
| "
|
|
304
|
+
| "notElectedParent"
|
|
305
|
+
/**
|
|
306
|
+
* We are not already running the summarizer and we are not the current elected client id.
|
|
307
|
+
*/
|
|
308
|
+
| "notElectedClient"
|
|
296
309
|
/** Summarizer client was disconnected */
|
|
297
310
|
| "summarizerClientDisconnected"
|
|
298
311
|
/* running summarizer threw an exception */
|
package/src/summaryFormat.ts
CHANGED
|
@@ -99,14 +99,16 @@ export interface IGCMetadata {
|
|
|
99
99
|
* - A value greater than 0 means GC is enabled.
|
|
100
100
|
*/
|
|
101
101
|
readonly gcFeature?: GCVersion;
|
|
102
|
-
/** If this is present, the session for this container will expire after this time and the container will close */
|
|
103
|
-
readonly sessionExpiryTimeoutMs?: number;
|
|
104
102
|
/**
|
|
105
103
|
* Tells whether the GC sweep phase is enabled for this container.
|
|
106
104
|
* - True means sweep phase is enabled.
|
|
107
105
|
* - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.
|
|
108
106
|
*/
|
|
109
107
|
readonly sweepEnabled?: boolean;
|
|
108
|
+
/** If this is present, the session for this container will expire after this time and the container will close */
|
|
109
|
+
readonly sessionExpiryTimeoutMs?: number;
|
|
110
|
+
/** How long to wait after an object is unreferenced before deleting it via GC Sweep */
|
|
111
|
+
readonly sweepTimeoutMs?: number;
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
/** The properties of an ISequencedDocumentMessage to be stored in the metadata blob in summary. */
|
package/src/summaryManager.ts
CHANGED
|
@@ -29,7 +29,8 @@ export enum SummaryManagerState {
|
|
|
29
29
|
// Please note that all reasons in this list are not errors,
|
|
30
30
|
// and thus they are not raised today to parent container as error.
|
|
31
31
|
// If this needs to be changed in future, we should re-evaluate what and how we raise to summarizer
|
|
32
|
-
type StopReason = Extract<SummarizerStopReason,
|
|
32
|
+
type StopReason = Extract<SummarizerStopReason,
|
|
33
|
+
"parentNotConnected" | "notElectedParent" | "notElectedClient">;
|
|
33
34
|
type ShouldSummarizeState =
|
|
34
35
|
| { shouldSummarize: true; }
|
|
35
36
|
| { shouldSummarize: false; stopReason: StopReason; };
|
|
@@ -141,13 +142,23 @@ export class SummaryManager implements IDisposable {
|
|
|
141
142
|
// enforce connectedState.clientId === clientElection.electedClientId. But once we're Running, we should
|
|
142
143
|
// only transition to Stopping when the electedParentId changes. Stopping the summarizer without
|
|
143
144
|
// changing the electedParent will just cause us to transition to Starting again.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return { shouldSummarize: false, stopReason: "
|
|
148
|
-
}
|
|
145
|
+
|
|
146
|
+
// New Parent has been elected and it is not the current client, or
|
|
147
|
+
if (this.connectedState.clientId !== this.clientElection.electedParentId) {
|
|
148
|
+
return { shouldSummarize: false, stopReason: "notElectedParent" };
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// We are not already running the summarizer and we are not the current elected client id.
|
|
152
|
+
if (this.state !== SummaryManagerState.Running &&
|
|
153
|
+
this.connectedState.clientId !== this.clientElection.electedClientId) {
|
|
154
|
+
return { shouldSummarize: false, stopReason: "notElectedClient" };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (!this.connectedState.connected) {
|
|
149
158
|
return { shouldSummarize: false, stopReason: "parentNotConnected" };
|
|
150
|
-
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (this.disposed) {
|
|
151
162
|
assert(false, 0x260 /* "Disposed should mean disconnected!" */);
|
|
152
163
|
} else {
|
|
153
164
|
return { shouldSummarize: true };
|