@fluidframework/container-runtime 2.4.0-299374 → 2.4.0-299707
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.map +1 -1
- package/dist/containerRuntime.js +22 -59
- package/dist/containerRuntime.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +2 -6
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +2 -0
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +16 -10
- package/dist/opLifecycle/outbox.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 +8 -2
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +14 -7
- package/dist/pendingStateManager.js.map +1 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +22 -59
- package/lib/containerRuntime.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +3 -7
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +2 -0
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +16 -10
- package/lib/opLifecycle/outbox.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 +8 -2
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +14 -7
- package/lib/pendingStateManager.js.map +1 -1
- package/package.json +20 -18
- package/src/containerRuntime.ts +43 -77
- package/src/gc/garbageCollection.ts +5 -12
- package/src/opLifecycle/batchManager.ts +3 -0
- package/src/opLifecycle/outbox.ts +21 -10
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +26 -8
package/lib/containerRuntime.js
CHANGED
|
@@ -32,16 +32,23 @@ import { ScheduleManager } from "./scheduleManager.js";
|
|
|
32
32
|
import { DocumentsSchemaController, OrderedClientCollection, OrderedClientElection, RetriableSummaryError, RunWhileConnectedCoordinator, Summarizer, SummarizerClientElection, SummaryCollection, SummaryManager, aliasBlobName, chunksBlobName, createRootSummarizerNodeWithGC, electedSummarizerBlobName, extractSummaryMetadataMessage, idCompressorBlobName, metadataBlobName, rootHasIsolatedChannels, summarizerClientType, wrapSummaryInChannelsTree, } from "./summary/index.js";
|
|
33
33
|
import { Throttler, formExponentialFn } from "./throttler.js";
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Creates an error object to be thrown / passed to Container's close fn in case of an unknown message type.
|
|
36
36
|
* The parameters are typed to support compile-time enforcement of handling all known types/behaviors
|
|
37
37
|
*
|
|
38
|
-
* @param
|
|
38
|
+
* @param unknownContainerRuntimeMessageType - Typed as something unexpected, to ensure all known types have been
|
|
39
39
|
* handled before calling this function (e.g. in a switch statement).
|
|
40
|
-
*
|
|
40
|
+
*
|
|
41
|
+
* @param codePath - The code path where the unexpected message type was encountered.
|
|
42
|
+
*
|
|
43
|
+
* @param sequencedMessage - The sequenced message that contained the unexpected message type.
|
|
44
|
+
*
|
|
41
45
|
*/
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
function getUnknownMessageTypeError(unknownContainerRuntimeMessageType, codePath, sequencedMessage) {
|
|
47
|
+
return DataProcessingError.create("Runtime message of unknown type", codePath, sequencedMessage, {
|
|
48
|
+
messageDetails: {
|
|
49
|
+
type: unknownContainerRuntimeMessageType,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
45
52
|
}
|
|
46
53
|
/**
|
|
47
54
|
* @legacy
|
|
@@ -1389,22 +1396,9 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1389
1396
|
// GC op is only sent in summarizer which should never have stashed ops.
|
|
1390
1397
|
throw new LoggingError("GC op not expected to be stashed in summarizer");
|
|
1391
1398
|
default: {
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
const compatBehavior = opContents.compatDetails?.behavior;
|
|
1396
|
-
if (!compatBehaviorAllowsMessageType(opContents.type, compatBehavior)) {
|
|
1397
|
-
const error = DataProcessingError.create("Stashed runtime message of unexpected type", "applyStashedOp", undefined /* sequencedMessage */, {
|
|
1398
|
-
messageDetails: JSON.stringify({
|
|
1399
|
-
type: opContents.type,
|
|
1400
|
-
compatBehavior,
|
|
1401
|
-
}),
|
|
1402
|
-
});
|
|
1403
|
-
this.closeFn(error);
|
|
1404
|
-
throw error;
|
|
1405
|
-
}
|
|
1406
|
-
// Note: Even if its compat behavior allows it, we don't know how to apply this stashed op.
|
|
1407
|
-
// All we can do is ignore it (similar to on process).
|
|
1399
|
+
const error = getUnknownMessageTypeError(opContents.type, "applyStashedOp" /* codePath */);
|
|
1400
|
+
this.closeFn(error);
|
|
1401
|
+
throw error;
|
|
1408
1402
|
}
|
|
1409
1403
|
}
|
|
1410
1404
|
}
|
|
@@ -1724,23 +1718,9 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
1724
1718
|
this.documentsSchemaController.processDocumentSchemaOp(message.contents, local, message.sequenceNumber);
|
|
1725
1719
|
break;
|
|
1726
1720
|
default: {
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
// Former assert 0x3ce
|
|
1731
|
-
"Runtime message of unknown type", "OpProcessing", message, {
|
|
1732
|
-
local,
|
|
1733
|
-
messageDetails: JSON.stringify({
|
|
1734
|
-
type: message.type,
|
|
1735
|
-
contentType: typeof message.contents,
|
|
1736
|
-
compatBehavior,
|
|
1737
|
-
batch: message.metadata?.batch,
|
|
1738
|
-
compression: message.compression,
|
|
1739
|
-
}),
|
|
1740
|
-
});
|
|
1741
|
-
this.closeFn(error);
|
|
1742
|
-
throw error;
|
|
1743
|
-
}
|
|
1721
|
+
const error = getUnknownMessageTypeError(message.type, "validateAndProcessRuntimeMessage" /* codePath */, message);
|
|
1722
|
+
this.closeFn(error);
|
|
1723
|
+
throw error;
|
|
1744
1724
|
}
|
|
1745
1725
|
}
|
|
1746
1726
|
this.emit("op", message, true /* runtimeMessage */);
|
|
@@ -2848,26 +2828,9 @@ export class ContainerRuntime extends TypedEventEmitter {
|
|
|
2848
2828
|
// send any ops, as some other client already changed schema.
|
|
2849
2829
|
break;
|
|
2850
2830
|
default: {
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
if (compatBehaviorAllowsMessageType(message.type, compatBehavior)) {
|
|
2855
|
-
// We do not ultimately resubmit it, to be consistent with this version of the code.
|
|
2856
|
-
this.logger.sendTelemetryEvent({
|
|
2857
|
-
eventName: "resubmitUnrecognizedMessageTypeAllowed",
|
|
2858
|
-
messageDetails: { type: message.type, compatBehavior },
|
|
2859
|
-
});
|
|
2860
|
-
}
|
|
2861
|
-
else {
|
|
2862
|
-
const error = DataProcessingError.create("Resubmitting runtime message of unexpected type", "reSubmitCore", undefined /* sequencedMessage */, {
|
|
2863
|
-
messageDetails: JSON.stringify({
|
|
2864
|
-
type: message.type,
|
|
2865
|
-
compatBehavior,
|
|
2866
|
-
}),
|
|
2867
|
-
});
|
|
2868
|
-
this.closeFn(error);
|
|
2869
|
-
throw error;
|
|
2870
|
-
}
|
|
2831
|
+
const error = getUnknownMessageTypeError(message.type, "reSubmitCore" /* codePath */);
|
|
2832
|
+
this.closeFn(error);
|
|
2833
|
+
throw error;
|
|
2871
2834
|
}
|
|
2872
2835
|
}
|
|
2873
2836
|
}
|