@fluidframework/container-runtime 2.0.0-dev-rc.5.0.0.271717 → 2.0.0-dev-rc.5.0.0.272251
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/api-extractor/api-extractor-lint-bundle.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
- package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-public.esm.json +5 -0
- package/api-report/container-runtime.alpha.api.md +1 -1
- package/container-runtime.test-files.tar +0 -0
- package/dist/channelCollection.d.ts +12 -2
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +85 -87
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerRuntime.d.ts +2 -1
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +25 -4
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +2 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +3 -2
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +4 -2
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +10 -6
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +7 -4
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +0 -5
- package/dist/gc/gcTelemetry.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/lib/channelCollection.d.ts +12 -2
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +85 -87
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerRuntime.d.ts +2 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +26 -5
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +2 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +3 -2
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +4 -2
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +10 -6
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +7 -4
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +0 -5
- package/lib/gc/gcTelemetry.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/package.json +27 -18
- package/src/channelCollection.ts +133 -123
- package/src/containerRuntime.ts +31 -4
- package/src/dataStoreContext.ts +3 -2
- package/src/gc/garbageCollection.ts +24 -7
- package/src/gc/gcDefinitions.ts +16 -4
- package/src/gc/gcTelemetry.ts +1 -7
- package/src/packageVersion.ts +1 -1
- package/tsdoc.json +4 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/legacy.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/legacy.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/public.d.ts"
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts"
|
|
5
|
+
}
|
|
@@ -101,7 +101,7 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents
|
|
|
101
101
|
protected constructor(context: IContainerContext, registry: IFluidDataStoreRegistry, metadata: IContainerRuntimeMetadata | undefined, electedSummarizerData: ISerializedElection | undefined, chunks: [string, string[]][], dataStoreAliasMap: [string, string][], runtimeOptions: Readonly<Required<IContainerRuntimeOptions>>, containerScope: FluidObject, baseLogger: ITelemetryBaseLogger, existing: boolean, blobManagerSnapshot: IBlobManagerLoadInfo, _storage: IDocumentStorageService, createIdCompressor: () => Promise<IIdCompressor & IIdCompressorCore>, documentsSchemaController: DocumentsSchemaController, featureGatesForTelemetry: Record<string, boolean | number | undefined>, provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>, requestHandler?: ((request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>) | undefined, summaryConfiguration?: ISummaryConfiguration);
|
|
102
102
|
// (undocumented)
|
|
103
103
|
protected addContainerStateToSummary(summaryTree: ISummaryTreeWithStats, fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext): void;
|
|
104
|
-
addedGCOutboundRoute(fromPath: string, toPath: string): void;
|
|
104
|
+
addedGCOutboundRoute(fromPath: string, toPath: string, messageTimestampMs?: number): void;
|
|
105
105
|
// (undocumented)
|
|
106
106
|
get attachState(): AttachState;
|
|
107
107
|
// (undocumented)
|
|
Binary file
|
|
@@ -88,7 +88,7 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
|
|
|
88
88
|
makeVisibleAndAttachGraph(): void;
|
|
89
89
|
private processAttachMessage;
|
|
90
90
|
private processAliasMessage;
|
|
91
|
-
processAliasMessageCore(internalId: string, alias: string): boolean;
|
|
91
|
+
processAliasMessageCore(internalId: string, alias: string, messageTimestampMs?: number): boolean;
|
|
92
92
|
private alreadyProcessed;
|
|
93
93
|
/** Package up the context's attach summary etc into an IAttachMessage */
|
|
94
94
|
private generateAttachMessage;
|
|
@@ -149,7 +149,6 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
|
|
|
149
149
|
setConnectionState(connected: boolean, clientId?: string): void;
|
|
150
150
|
setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
|
|
151
151
|
get size(): number;
|
|
152
|
-
summarize(fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
|
|
153
152
|
/**
|
|
154
153
|
* Create a summary. Used when attaching or serializing a detached container.
|
|
155
154
|
*/
|
|
@@ -158,6 +157,17 @@ export declare class ChannelCollection implements IFluidDataStoreChannel, IDispo
|
|
|
158
157
|
* Gets the GC data. Used when attaching or serializing a detached container.
|
|
159
158
|
*/
|
|
160
159
|
getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData;
|
|
160
|
+
/**
|
|
161
|
+
* Helper method for preparing to attach this channel.
|
|
162
|
+
* Runs the callback for each bound context to incorporate its data however the caller specifies
|
|
163
|
+
*/
|
|
164
|
+
private visitLocalBoundContextsDuringAttach;
|
|
165
|
+
/**
|
|
166
|
+
* Helper method for preparing to summarize this channel.
|
|
167
|
+
* Runs the callback for each bound context to incorporate its data however the caller specifies
|
|
168
|
+
*/
|
|
169
|
+
private visitContextsDuringSummary;
|
|
170
|
+
summarize(fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
|
|
161
171
|
/**
|
|
162
172
|
* Generates data used for garbage collection. It does the following:
|
|
163
173
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelCollection.d.ts","sourceRoot":"","sources":["../src/channelCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EACN,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EACN,aAAa,EACb,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AAMrD,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EAGX,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EAGnB,kCAAkC,EAElC,qBAAqB,EAErB,MAAM,8CAA8C,CAAC;AAgBtD,OAAO,EAIN,iBAAiB,EAKjB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAEN,iBAAiB,EAEjB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAEN,8BAA8B,EAC9B,wCAAwC,EAExC,0BAA0B,EAG1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAmB,MAAM,eA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AAC,QAAQ,CAAC,iBAAiB;IAGlC,OAAO,CAAC,QAAQ,CAAC,IAAI;IAVtB,SAAgB,IAAI,8BAA8B;IAE3C,uBAAuB,EAAE,uBAAuB,CAAC;gBAGvD,eAAe,EAAE,kCAAkC,EAElC,iBAAiB,EAAE,CACnC,OAAO,EAAE,sBAAsB,KAC3B,OAAO,CAAC,WAAW,CAAC,EACR,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,iBAAiB,CAAC,KAAK,CAAC;IAKvF,IAAW,sBAAsB,SAEhC;IAEY,oBAAoB,CAChC,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAE,OAAO,GAChB,OAAO,CAAC,sBAAsB,CAAC;CAalC"}
|
|
@@ -266,7 +266,7 @@ class ChannelCollection {
|
|
|
266
266
|
const foundGCData = (0, internal_5.processAttachMessageGCData)(attachMessage.snapshot, (nodeId, toPath) => {
|
|
267
267
|
// nodeId is the relative path under the node being attached. Always starts with "/", but no trailing "/" after an id
|
|
268
268
|
const fromPath = `/${attachMessage.id}${nodeId === "/" ? "" : nodeId}`;
|
|
269
|
-
this.parentContext.addedGCOutboundRoute(fromPath, toPath);
|
|
269
|
+
this.parentContext.addedGCOutboundRoute(fromPath, toPath, message.timestamp);
|
|
270
270
|
});
|
|
271
271
|
// Only log once per container to avoid noise/cost.
|
|
272
272
|
// Allows longitudinal tracking of various state (e.g. foundGCData), and some sampled details
|
|
@@ -338,12 +338,12 @@ class ChannelCollection {
|
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
340
|
const resolve = localOpMetadata;
|
|
341
|
-
const aliasResult = this.processAliasMessageCore(aliasMessage.internalId, aliasMessage.alias);
|
|
341
|
+
const aliasResult = this.processAliasMessageCore(aliasMessage.internalId, aliasMessage.alias, message.timestamp);
|
|
342
342
|
if (local) {
|
|
343
343
|
resolve(aliasResult);
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
processAliasMessageCore(internalId, alias) {
|
|
346
|
+
processAliasMessageCore(internalId, alias, messageTimestampMs) {
|
|
347
347
|
if (this.alreadyProcessed(alias)) {
|
|
348
348
|
return false;
|
|
349
349
|
}
|
|
@@ -360,7 +360,11 @@ class ChannelCollection {
|
|
|
360
360
|
});
|
|
361
361
|
return false;
|
|
362
362
|
}
|
|
363
|
-
this.
|
|
363
|
+
// If message timestamp doesn't exist, this is called in a detached container. Don't notify GC in that case
|
|
364
|
+
// because it doesn't run in detached container and doesn't need to know about this route.
|
|
365
|
+
if (messageTimestampMs) {
|
|
366
|
+
this.parentContext.addedGCOutboundRoute("/", `/${internalId}`, messageTimestampMs);
|
|
367
|
+
}
|
|
364
368
|
this.aliasMap.set(alias, context.id);
|
|
365
369
|
this.aliasedDataStores.add(context.id);
|
|
366
370
|
context.setInMemoryRoot();
|
|
@@ -593,7 +597,7 @@ class ChannelCollection {
|
|
|
593
597
|
};
|
|
594
598
|
this.processChannelOp(envelope.address, transformed, local, localMessageMetadata);
|
|
595
599
|
// Notify GC of any outbound references that were added by this op.
|
|
596
|
-
detectOutboundReferences(envelope.address, transformed.contents, (fromPath, toPath) => this.parentContext.addedGCOutboundRoute(fromPath, toPath));
|
|
600
|
+
detectOutboundReferences(envelope.address, transformed.contents, (fromPath, toPath) => this.parentContext.addedGCOutboundRoute(fromPath, toPath, message.timestamp));
|
|
597
601
|
break;
|
|
598
602
|
}
|
|
599
603
|
default:
|
|
@@ -766,61 +770,24 @@ class ChannelCollection {
|
|
|
766
770
|
get size() {
|
|
767
771
|
return this.contexts.size;
|
|
768
772
|
}
|
|
769
|
-
async summarize(fullTree, trackState, telemetryContext) {
|
|
770
|
-
const summaryBuilder = new internal_5.SummaryTreeBuilder();
|
|
771
|
-
// Iterate over each store and ask it to snapshot
|
|
772
|
-
await Promise.all(Array.from(this.contexts)
|
|
773
|
-
.filter(([_, context]) => {
|
|
774
|
-
// Summarizer works only with clients with no local changes. A data store in attaching
|
|
775
|
-
// state indicates an op was sent to attach a local data store, and the the attach op
|
|
776
|
-
// had not yet round tripped back to the client.
|
|
777
|
-
if (context.attachState === container_definitions_1.AttachState.Attaching) {
|
|
778
|
-
// Formerly assert 0x588
|
|
779
|
-
const error = internal_6.DataProcessingError.create("Local data store detected in attaching state during summarize", "summarize");
|
|
780
|
-
throw error;
|
|
781
|
-
}
|
|
782
|
-
return context.attachState === container_definitions_1.AttachState.Attached;
|
|
783
|
-
})
|
|
784
|
-
.map(async ([contextId, context]) => {
|
|
785
|
-
const contextSummary = await context.summarize(fullTree, trackState, telemetryContext);
|
|
786
|
-
summaryBuilder.addWithStats(contextId, contextSummary);
|
|
787
|
-
}));
|
|
788
|
-
return summaryBuilder.getSummaryTree();
|
|
789
|
-
}
|
|
790
773
|
/**
|
|
791
774
|
* Create a summary. Used when attaching or serializing a detached container.
|
|
792
775
|
*/
|
|
793
776
|
getAttachSummary(telemetryContext) {
|
|
794
777
|
const builder = new internal_5.SummaryTreeBuilder();
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
builderTree[key] ||
|
|
809
|
-
this.attachOpFiredForDataStore.has(key)))
|
|
810
|
-
.map(([key, value]) => {
|
|
811
|
-
let dataStoreSummary;
|
|
812
|
-
if (value.isLoaded) {
|
|
813
|
-
dataStoreSummary = value.getAttachSummary(telemetryContext);
|
|
814
|
-
}
|
|
815
|
-
else {
|
|
816
|
-
// If this data store is not yet loaded, then there should be no changes in the snapshot from
|
|
817
|
-
// which it was created as it is detached container. So just use the previous snapshot.
|
|
818
|
-
(0, internal_1.assert)(!!this.baseSnapshot, 0x166 /* "BaseSnapshot should be there as detached container loaded from snapshot" */);
|
|
819
|
-
dataStoreSummary = (0, internal_5.convertSnapshotTreeToSummaryTree)((0, internal_3.getSnapshotTree)(this.baseSnapshot).trees[key]);
|
|
820
|
-
}
|
|
821
|
-
builder.addWithStats(key, dataStoreSummary);
|
|
822
|
-
});
|
|
823
|
-
} while (notBoundContextsLength !== this.contexts.notBoundLength());
|
|
778
|
+
this.visitLocalBoundContextsDuringAttach((contextId, context) => {
|
|
779
|
+
let dataStoreSummary;
|
|
780
|
+
if (context.isLoaded) {
|
|
781
|
+
dataStoreSummary = context.getAttachSummary(telemetryContext);
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
// If this data store is not yet loaded, then there should be no changes in the snapshot from
|
|
785
|
+
// which it was created as it is detached container. So just use the previous snapshot.
|
|
786
|
+
(0, internal_1.assert)(!!this.baseSnapshot, 0x166 /* "BaseSnapshot should be there as detached container loaded from snapshot" */);
|
|
787
|
+
dataStoreSummary = (0, internal_5.convertSnapshotTreeToSummaryTree)((0, internal_3.getSnapshotTree)(this.baseSnapshot).trees[contextId]);
|
|
788
|
+
}
|
|
789
|
+
builder.addWithStats(contextId, dataStoreSummary);
|
|
790
|
+
});
|
|
824
791
|
return builder.getSummaryTree();
|
|
825
792
|
}
|
|
826
793
|
/**
|
|
@@ -828,27 +795,70 @@ class ChannelCollection {
|
|
|
828
795
|
*/
|
|
829
796
|
getAttachGCData(telemetryContext) {
|
|
830
797
|
const builder = new internal_5.GCDataBuilder();
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
Array.from(this.contexts)
|
|
838
|
-
.filter(([key, _]) =>
|
|
839
|
-
// Take GC data of bounded data stores only.
|
|
840
|
-
!this.contexts.isNotBound(key))
|
|
841
|
-
.map(([key, value]) => {
|
|
842
|
-
const contextGCData = value.getAttachGCData(telemetryContext);
|
|
843
|
-
// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.
|
|
844
|
-
// This also gradually builds the id of each node to be a path from the root.
|
|
845
|
-
builder.prefixAndAddNodes(key, contextGCData.gcNodes);
|
|
846
|
-
});
|
|
847
|
-
} while (notBoundContextsLength !== this.contexts.notBoundLength());
|
|
798
|
+
this.visitLocalBoundContextsDuringAttach((contextId, context) => {
|
|
799
|
+
const contextGCData = context.getAttachGCData(telemetryContext);
|
|
800
|
+
// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.
|
|
801
|
+
// This also gradually builds the id of each node to be a path from the root.
|
|
802
|
+
builder.prefixAndAddNodes(contextId, contextGCData.gcNodes);
|
|
803
|
+
});
|
|
848
804
|
// Get the outbound routes (aliased data stores) and add a GC node for this channel.
|
|
849
805
|
builder.addNode("/", Array.from(this.aliasedDataStores));
|
|
850
806
|
return builder.getGCData();
|
|
851
807
|
}
|
|
808
|
+
/**
|
|
809
|
+
* Helper method for preparing to attach this channel.
|
|
810
|
+
* Runs the callback for each bound context to incorporate its data however the caller specifies
|
|
811
|
+
*/
|
|
812
|
+
visitLocalBoundContextsDuringAttach(visitor) {
|
|
813
|
+
const visitedContexts = new Set();
|
|
814
|
+
let visitedLength = -1;
|
|
815
|
+
let notBoundContextsLength = -1;
|
|
816
|
+
while (visitedLength !== visitedContexts.size &&
|
|
817
|
+
notBoundContextsLength !== this.contexts.notBoundLength()) {
|
|
818
|
+
// detect changes in the visitedContexts set, as on visiting a context
|
|
819
|
+
// it could could make contexts available by removing other contexts
|
|
820
|
+
// from the not bound context list, so we need to ensure those get processed as well.
|
|
821
|
+
// only once the loop can run with no new contexts added to the visitedContexts set do we
|
|
822
|
+
// know for sure all possible contexts have been visited.
|
|
823
|
+
visitedLength = visitedContexts.size;
|
|
824
|
+
notBoundContextsLength = this.contexts.notBoundLength();
|
|
825
|
+
for (const [contextId, context] of this.contexts) {
|
|
826
|
+
if (!(visitedContexts.has(contextId) ||
|
|
827
|
+
this.contexts.isNotBound(contextId) ||
|
|
828
|
+
this.attachOpFiredForDataStore.has(contextId))) {
|
|
829
|
+
visitor(contextId, context);
|
|
830
|
+
visitedContexts.add(contextId);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Helper method for preparing to summarize this channel.
|
|
837
|
+
* Runs the callback for each bound context to incorporate its data however the caller specifies
|
|
838
|
+
*/
|
|
839
|
+
async visitContextsDuringSummary(visitor) {
|
|
840
|
+
for (const [contextId, context] of this.contexts) {
|
|
841
|
+
// Summarizer client and hence GC works only with clients with no local changes. A data store in
|
|
842
|
+
// attaching state indicates an op was sent to attach a local data store, and the the attach op
|
|
843
|
+
// had not yet round tripped back to the client.
|
|
844
|
+
// Formerly assert 0x589
|
|
845
|
+
if (context.attachState === container_definitions_1.AttachState.Attaching) {
|
|
846
|
+
const error = internal_6.DataProcessingError.create("Local data store detected in attaching state", "summarize/getGCData");
|
|
847
|
+
throw error;
|
|
848
|
+
}
|
|
849
|
+
if (context.attachState === container_definitions_1.AttachState.Attached) {
|
|
850
|
+
await visitor(contextId, context);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
async summarize(fullTree, trackState, telemetryContext) {
|
|
855
|
+
const summaryBuilder = new internal_5.SummaryTreeBuilder();
|
|
856
|
+
await this.visitContextsDuringSummary(async (contextId, context) => {
|
|
857
|
+
const contextSummary = await context.summarize(fullTree, trackState, telemetryContext);
|
|
858
|
+
summaryBuilder.addWithStats(contextId, contextSummary);
|
|
859
|
+
});
|
|
860
|
+
return summaryBuilder.getSummaryTree();
|
|
861
|
+
}
|
|
852
862
|
/**
|
|
853
863
|
* Generates data used for garbage collection. It does the following:
|
|
854
864
|
*
|
|
@@ -864,25 +874,12 @@ class ChannelCollection {
|
|
|
864
874
|
*/
|
|
865
875
|
async getGCData(fullGC = false) {
|
|
866
876
|
const builder = new internal_5.GCDataBuilder();
|
|
867
|
-
|
|
868
|
-
await Promise.all(Array.from(this.contexts)
|
|
869
|
-
.filter(([_, context]) => {
|
|
870
|
-
// Summarizer client and hence GC works only with clients with no local changes. A data store in
|
|
871
|
-
// attaching state indicates an op was sent to attach a local data store, and the the attach op
|
|
872
|
-
// had not yet round tripped back to the client.
|
|
873
|
-
// Formerly assert 0x589
|
|
874
|
-
if (context.attachState === container_definitions_1.AttachState.Attaching) {
|
|
875
|
-
const error = internal_6.DataProcessingError.create("Local data store detected in attaching state while running GC", "getGCData");
|
|
876
|
-
throw error;
|
|
877
|
-
}
|
|
878
|
-
return context.attachState === container_definitions_1.AttachState.Attached;
|
|
879
|
-
})
|
|
880
|
-
.map(async ([contextId, context]) => {
|
|
877
|
+
await this.visitContextsDuringSummary(async (contextId, context) => {
|
|
881
878
|
const contextGCData = await context.getGCData(fullGC);
|
|
882
879
|
// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.
|
|
883
880
|
// This also gradually builds the id of each node to be a path from the root.
|
|
884
881
|
builder.prefixAndAddNodes(contextId, contextGCData.gcNodes);
|
|
885
|
-
})
|
|
882
|
+
});
|
|
886
883
|
// Get the outbound routes and add a GC node for this channel.
|
|
887
884
|
builder.addNode("/", await this.getOutboundRoutes());
|
|
888
885
|
return builder.getGCData();
|
|
@@ -1059,6 +1056,7 @@ class ChannelCollection {
|
|
|
1059
1056
|
packagePath: details.pkg,
|
|
1060
1057
|
request,
|
|
1061
1058
|
headerData,
|
|
1059
|
+
timestampMs: undefined, // This will be added by the parent context if needed.
|
|
1062
1060
|
});
|
|
1063
1061
|
const dataStore = await dataStoreContext.realize();
|
|
1064
1062
|
const subRequest = requestParser.createSubRequest(1);
|