@fluidframework/container-runtime 2.4.0-297385 → 2.4.0-299374
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/container-runtime.test-files.tar +0 -0
- package/dist/containerRuntime.d.ts +8 -0
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +72 -52
- package/dist/containerRuntime.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/containerRuntime.d.ts +8 -0
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +72 -52
- package/lib/containerRuntime.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 +19 -20
- package/src/containerRuntime.ts +90 -70
- package/src/packageVersion.ts +1 -1
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/container-runtime";
|
|
8
|
-
export declare const pkgVersion = "2.4.0-
|
|
8
|
+
export declare const pkgVersion = "2.4.0-299374";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.4.0-
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.4.0-299374\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-runtime",
|
|
3
|
-
"version": "2.4.0-
|
|
3
|
+
"version": "2.4.0-299374",
|
|
4
4
|
"description": "Fluid container runtime",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -127,18 +127,18 @@
|
|
|
127
127
|
"temp-directory": "nyc/.nyc_output"
|
|
128
128
|
},
|
|
129
129
|
"dependencies": {
|
|
130
|
-
"@fluid-internal/client-utils": "2.4.0-
|
|
131
|
-
"@fluidframework/container-definitions": "2.4.0-
|
|
132
|
-
"@fluidframework/container-runtime-definitions": "2.4.0-
|
|
133
|
-
"@fluidframework/core-interfaces": "2.4.0-
|
|
134
|
-
"@fluidframework/core-utils": "2.4.0-
|
|
135
|
-
"@fluidframework/datastore": "2.4.0-
|
|
136
|
-
"@fluidframework/driver-definitions": "2.4.0-
|
|
137
|
-
"@fluidframework/driver-utils": "2.4.0-
|
|
138
|
-
"@fluidframework/id-compressor": "2.4.0-
|
|
139
|
-
"@fluidframework/runtime-definitions": "2.4.0-
|
|
140
|
-
"@fluidframework/runtime-utils": "2.4.0-
|
|
141
|
-
"@fluidframework/telemetry-utils": "2.4.0-
|
|
130
|
+
"@fluid-internal/client-utils": "2.4.0-299374",
|
|
131
|
+
"@fluidframework/container-definitions": "2.4.0-299374",
|
|
132
|
+
"@fluidframework/container-runtime-definitions": "2.4.0-299374",
|
|
133
|
+
"@fluidframework/core-interfaces": "2.4.0-299374",
|
|
134
|
+
"@fluidframework/core-utils": "2.4.0-299374",
|
|
135
|
+
"@fluidframework/datastore": "2.4.0-299374",
|
|
136
|
+
"@fluidframework/driver-definitions": "2.4.0-299374",
|
|
137
|
+
"@fluidframework/driver-utils": "2.4.0-299374",
|
|
138
|
+
"@fluidframework/id-compressor": "2.4.0-299374",
|
|
139
|
+
"@fluidframework/runtime-definitions": "2.4.0-299374",
|
|
140
|
+
"@fluidframework/runtime-utils": "2.4.0-299374",
|
|
141
|
+
"@fluidframework/telemetry-utils": "2.4.0-299374",
|
|
142
142
|
"@tylerbu/sorted-btree-es6": "^1.8.0",
|
|
143
143
|
"double-ended-queue": "^2.1.0-0",
|
|
144
144
|
"lz4js": "^0.2.0",
|
|
@@ -147,16 +147,16 @@
|
|
|
147
147
|
"devDependencies": {
|
|
148
148
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
149
149
|
"@biomejs/biome": "~1.8.3",
|
|
150
|
-
"@fluid-internal/mocha-test-setup": "2.4.0-
|
|
151
|
-
"@fluid-private/stochastic-test-utils": "2.4.0-
|
|
152
|
-
"@fluid-private/test-pairwise-generator": "2.4.0-
|
|
150
|
+
"@fluid-internal/mocha-test-setup": "2.4.0-299374",
|
|
151
|
+
"@fluid-private/stochastic-test-utils": "2.4.0-299374",
|
|
152
|
+
"@fluid-private/test-pairwise-generator": "2.4.0-299374",
|
|
153
153
|
"@fluid-tools/benchmark": "^0.50.0",
|
|
154
|
-
"@fluid-tools/build-cli": "^0.
|
|
154
|
+
"@fluid-tools/build-cli": "^0.48.0",
|
|
155
155
|
"@fluidframework/build-common": "^2.0.3",
|
|
156
|
-
"@fluidframework/build-tools": "^0.
|
|
156
|
+
"@fluidframework/build-tools": "^0.48.0",
|
|
157
157
|
"@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@~2.3.0",
|
|
158
158
|
"@fluidframework/eslint-config-fluid": "^5.4.0",
|
|
159
|
-
"@fluidframework/test-runtime-utils": "2.4.0-
|
|
159
|
+
"@fluidframework/test-runtime-utils": "2.4.0-299374",
|
|
160
160
|
"@microsoft/api-extractor": "7.47.8",
|
|
161
161
|
"@types/double-ended-queue": "^2.1.0",
|
|
162
162
|
"@types/mocha": "^9.1.1",
|
|
@@ -169,7 +169,6 @@
|
|
|
169
169
|
"cross-env": "^7.0.3",
|
|
170
170
|
"eslint": "~8.55.0",
|
|
171
171
|
"mocha": "^10.2.0",
|
|
172
|
-
"mocha-json-output-reporter": "^2.0.1",
|
|
173
172
|
"mocha-multi-reporters": "^1.5.1",
|
|
174
173
|
"moment": "^2.21.0",
|
|
175
174
|
"prettier": "~3.0.3",
|
package/src/containerRuntime.ts
CHANGED
|
@@ -1148,6 +1148,9 @@ export class ContainerRuntime
|
|
|
1148
1148
|
summaryOp: ISummaryContent,
|
|
1149
1149
|
referenceSequenceNumber?: number,
|
|
1150
1150
|
) => number;
|
|
1151
|
+
/**
|
|
1152
|
+
* Do not call directly - use submitAddressesSignal
|
|
1153
|
+
*/
|
|
1151
1154
|
private readonly submitSignalFn: (content: ISignalEnvelope, targetClientId?: string) => void;
|
|
1152
1155
|
public readonly disposeFn: (error?: ICriticalContainerError) => void;
|
|
1153
1156
|
public readonly closeFn: (error?: ICriticalContainerError) => void;
|
|
@@ -1755,7 +1758,7 @@ export class ContainerRuntime
|
|
|
1755
1758
|
type,
|
|
1756
1759
|
envelope1.contents,
|
|
1757
1760
|
);
|
|
1758
|
-
return this.
|
|
1761
|
+
return this.submitEnvelopedSignal(envelope2, targetClientId);
|
|
1759
1762
|
};
|
|
1760
1763
|
|
|
1761
1764
|
let snapshot: ISnapshot | ISnapshotTree | undefined = getSummaryForDatastores(
|
|
@@ -3021,6 +3024,72 @@ export class ContainerRuntime
|
|
|
3021
3024
|
this._signalTracking.totalSignalsSentInLatencyWindow = 0;
|
|
3022
3025
|
}
|
|
3023
3026
|
|
|
3027
|
+
/**
|
|
3028
|
+
* Updates signal telemetry including emitting telemetry events.
|
|
3029
|
+
*/
|
|
3030
|
+
private processSignalForTelemetry(envelope: ISignalEnvelope): void {
|
|
3031
|
+
const { clientBroadcastSignalSequenceNumber } = envelope;
|
|
3032
|
+
if (clientBroadcastSignalSequenceNumber === undefined) {
|
|
3033
|
+
return;
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
if (
|
|
3037
|
+
this._signalTracking.trackingSignalSequenceNumber === undefined ||
|
|
3038
|
+
this._signalTracking.minimumTrackingSignalSequenceNumber === undefined
|
|
3039
|
+
) {
|
|
3040
|
+
return;
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
if (
|
|
3044
|
+
clientBroadcastSignalSequenceNumber >= this._signalTracking.trackingSignalSequenceNumber
|
|
3045
|
+
) {
|
|
3046
|
+
// Calculate the number of signals lost and log the event.
|
|
3047
|
+
const signalsLost =
|
|
3048
|
+
clientBroadcastSignalSequenceNumber -
|
|
3049
|
+
this._signalTracking.trackingSignalSequenceNumber;
|
|
3050
|
+
if (signalsLost > 0) {
|
|
3051
|
+
this._signalTracking.signalsLost += signalsLost;
|
|
3052
|
+
this.mc.logger.sendErrorEvent({
|
|
3053
|
+
eventName: "SignalLost",
|
|
3054
|
+
signalsLost, // Number of lost signals detected.
|
|
3055
|
+
trackingSequenceNumber: this._signalTracking.trackingSignalSequenceNumber, // The next expected signal sequence number.
|
|
3056
|
+
clientBroadcastSignalSequenceNumber, // Actual signal sequence number received.
|
|
3057
|
+
});
|
|
3058
|
+
}
|
|
3059
|
+
// Update the tracking signal sequence number to the next expected signal in the sequence.
|
|
3060
|
+
this._signalTracking.trackingSignalSequenceNumber =
|
|
3061
|
+
clientBroadcastSignalSequenceNumber + 1;
|
|
3062
|
+
} else if (
|
|
3063
|
+
// Check if this is a signal in range of interest.
|
|
3064
|
+
clientBroadcastSignalSequenceNumber >=
|
|
3065
|
+
this._signalTracking.minimumTrackingSignalSequenceNumber
|
|
3066
|
+
) {
|
|
3067
|
+
this._signalTracking.signalsOutOfOrder++;
|
|
3068
|
+
this.mc.logger.sendTelemetryEvent({
|
|
3069
|
+
eventName: "SignalOutOfOrder",
|
|
3070
|
+
type: envelope.contents.type, // Type of signal that was received out of order.
|
|
3071
|
+
trackingSequenceNumber: this._signalTracking.trackingSignalSequenceNumber, // The next expected signal sequence number.
|
|
3072
|
+
clientBroadcastSignalSequenceNumber, // Sequence number of the out of order signal.
|
|
3073
|
+
});
|
|
3074
|
+
}
|
|
3075
|
+
if (
|
|
3076
|
+
this._signalTracking.roundTripSignalSequenceNumber !== undefined &&
|
|
3077
|
+
clientBroadcastSignalSequenceNumber >= this._signalTracking.roundTripSignalSequenceNumber
|
|
3078
|
+
) {
|
|
3079
|
+
if (
|
|
3080
|
+
clientBroadcastSignalSequenceNumber ===
|
|
3081
|
+
this._signalTracking.roundTripSignalSequenceNumber
|
|
3082
|
+
) {
|
|
3083
|
+
// Latency tracked signal has been received.
|
|
3084
|
+
// We now log the roundtrip duration of the tracked signal.
|
|
3085
|
+
// This telemetry event also logs metrics for signals sent, signals lost, and out of order signals received.
|
|
3086
|
+
// These metrics are reset after logging the telemetry event.
|
|
3087
|
+
this.sendSignalTelemetryEvent();
|
|
3088
|
+
}
|
|
3089
|
+
this._signalTracking.roundTripSignalSequenceNumber = undefined;
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3024
3093
|
public processSignal(message: ISignalMessage, local: boolean) {
|
|
3025
3094
|
const envelope = message.content as ISignalEnvelope;
|
|
3026
3095
|
const transformed: IInboundSignalMessage = {
|
|
@@ -3033,64 +3102,15 @@ export class ContainerRuntime
|
|
|
3033
3102
|
// Only collect signal telemetry for broadcast messages sent by the current client.
|
|
3034
3103
|
if (
|
|
3035
3104
|
message.clientId === this.clientId &&
|
|
3036
|
-
|
|
3037
|
-
|
|
3105
|
+
// jason-ha: This `connected` check seems incorrect. Signals that come through
|
|
3106
|
+
// here must have been received while connected to service and there is no need
|
|
3107
|
+
// to avoid processing when connection has dropped. Because container runtime's
|
|
3108
|
+
// `connected` (and `_connected`) state also reflects some ops state, it may
|
|
3109
|
+
// easily be false when newly connected and signal tracking may very well
|
|
3110
|
+
// complain lost signals (that were simply skipped per this check).
|
|
3111
|
+
this.connected
|
|
3038
3112
|
) {
|
|
3039
|
-
|
|
3040
|
-
this._signalTracking.trackingSignalSequenceNumber !== undefined &&
|
|
3041
|
-
this._signalTracking.minimumTrackingSignalSequenceNumber !== undefined
|
|
3042
|
-
) {
|
|
3043
|
-
if (
|
|
3044
|
-
envelope.clientBroadcastSignalSequenceNumber >=
|
|
3045
|
-
this._signalTracking.trackingSignalSequenceNumber
|
|
3046
|
-
) {
|
|
3047
|
-
// Calculate the number of signals lost and log the event.
|
|
3048
|
-
const signalsLost =
|
|
3049
|
-
envelope.clientBroadcastSignalSequenceNumber -
|
|
3050
|
-
this._signalTracking.trackingSignalSequenceNumber;
|
|
3051
|
-
if (signalsLost > 0) {
|
|
3052
|
-
this._signalTracking.signalsLost += signalsLost;
|
|
3053
|
-
this.mc.logger.sendErrorEvent({
|
|
3054
|
-
eventName: "SignalLost",
|
|
3055
|
-
signalsLost, // Number of lost signals detected.
|
|
3056
|
-
trackingSequenceNumber: this._signalTracking.trackingSignalSequenceNumber, // The next expected signal sequence number.
|
|
3057
|
-
clientBroadcastSignalSequenceNumber:
|
|
3058
|
-
envelope.clientBroadcastSignalSequenceNumber, // Actual signal sequence number received.
|
|
3059
|
-
});
|
|
3060
|
-
}
|
|
3061
|
-
// Update the tracking signal sequence number to the next expected signal in the sequence.
|
|
3062
|
-
this._signalTracking.trackingSignalSequenceNumber =
|
|
3063
|
-
envelope.clientBroadcastSignalSequenceNumber + 1;
|
|
3064
|
-
} else if (
|
|
3065
|
-
envelope.clientBroadcastSignalSequenceNumber >=
|
|
3066
|
-
this._signalTracking.minimumTrackingSignalSequenceNumber
|
|
3067
|
-
) {
|
|
3068
|
-
this._signalTracking.signalsOutOfOrder++;
|
|
3069
|
-
this.mc.logger.sendTelemetryEvent({
|
|
3070
|
-
eventName: "SignalOutOfOrder",
|
|
3071
|
-
type: envelope.contents.type, // Type of signal that was received out of order.
|
|
3072
|
-
trackingSequenceNumber: this._signalTracking.trackingSignalSequenceNumber, // The next expected signal sequence number.
|
|
3073
|
-
clientBroadcastSignalSequenceNumber: envelope.clientBroadcastSignalSequenceNumber, // Sequence number of the out of order signal.
|
|
3074
|
-
});
|
|
3075
|
-
}
|
|
3076
|
-
if (
|
|
3077
|
-
this._signalTracking.roundTripSignalSequenceNumber !== undefined &&
|
|
3078
|
-
envelope.clientBroadcastSignalSequenceNumber >=
|
|
3079
|
-
this._signalTracking.roundTripSignalSequenceNumber
|
|
3080
|
-
) {
|
|
3081
|
-
if (
|
|
3082
|
-
envelope.clientBroadcastSignalSequenceNumber ===
|
|
3083
|
-
this._signalTracking.roundTripSignalSequenceNumber
|
|
3084
|
-
) {
|
|
3085
|
-
// Latency tracked signal has been received.
|
|
3086
|
-
// We now log the roundtrip duration of the tracked signal.
|
|
3087
|
-
// This telemetry event also logs metrics for signals sent, signals lost, and out of order signals received.
|
|
3088
|
-
// These metrics are reset after logging the telemetry event.
|
|
3089
|
-
this.sendSignalTelemetryEvent();
|
|
3090
|
-
}
|
|
3091
|
-
this._signalTracking.roundTripSignalSequenceNumber = undefined;
|
|
3092
|
-
}
|
|
3093
|
-
}
|
|
3113
|
+
this.processSignalForTelemetry(envelope);
|
|
3094
3114
|
}
|
|
3095
3115
|
|
|
3096
3116
|
if (envelope.address === undefined) {
|
|
@@ -3337,19 +3357,24 @@ export class ContainerRuntime
|
|
|
3337
3357
|
address: string | undefined,
|
|
3338
3358
|
type: string,
|
|
3339
3359
|
content: any,
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
const newEnvelope: ISignalEnvelope = {
|
|
3360
|
+
): Omit<ISignalEnvelope, "broadcastSignalSequenceNumber"> {
|
|
3361
|
+
const newEnvelope: Omit<ISignalEnvelope, "broadcastSignalSequenceNumber"> = {
|
|
3343
3362
|
address,
|
|
3344
3363
|
contents: { type, content },
|
|
3345
3364
|
};
|
|
3346
3365
|
|
|
3366
|
+
return newEnvelope;
|
|
3367
|
+
}
|
|
3368
|
+
|
|
3369
|
+
private submitEnvelopedSignal(envelope: ISignalEnvelope, targetClientId?: string) {
|
|
3347
3370
|
const isBroadcastSignal = targetClientId === undefined;
|
|
3348
3371
|
|
|
3349
3372
|
if (isBroadcastSignal) {
|
|
3350
3373
|
const clientBroadcastSignalSequenceNumber = ++this._signalTracking
|
|
3351
3374
|
.broadcastSignalSequenceNumber;
|
|
3352
|
-
|
|
3375
|
+
// Stamp with the broadcast signal sequence number.
|
|
3376
|
+
envelope.clientBroadcastSignalSequenceNumber = clientBroadcastSignalSequenceNumber;
|
|
3377
|
+
|
|
3353
3378
|
this._signalTracking.signalsSentSinceLastLatencyMeasurement++;
|
|
3354
3379
|
|
|
3355
3380
|
if (
|
|
@@ -3378,7 +3403,7 @@ export class ContainerRuntime
|
|
|
3378
3403
|
}
|
|
3379
3404
|
}
|
|
3380
3405
|
|
|
3381
|
-
|
|
3406
|
+
this.submitSignalFn(envelope, targetClientId);
|
|
3382
3407
|
}
|
|
3383
3408
|
|
|
3384
3409
|
/**
|
|
@@ -3395,13 +3420,8 @@ export class ContainerRuntime
|
|
|
3395
3420
|
*/
|
|
3396
3421
|
public submitSignal(type: string, content: unknown, targetClientId?: string) {
|
|
3397
3422
|
this.verifyNotClosed();
|
|
3398
|
-
const envelope = this.createNewSignalEnvelope(
|
|
3399
|
-
|
|
3400
|
-
type,
|
|
3401
|
-
content,
|
|
3402
|
-
targetClientId,
|
|
3403
|
-
);
|
|
3404
|
-
return this.submitSignalFn(envelope, targetClientId);
|
|
3423
|
+
const envelope = this.createNewSignalEnvelope(undefined /* address */, type, content);
|
|
3424
|
+
return this.submitEnvelopedSignal(envelope, targetClientId);
|
|
3405
3425
|
}
|
|
3406
3426
|
|
|
3407
3427
|
public setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {
|
package/src/packageVersion.ts
CHANGED