@fluidframework/container-loader 2.0.0-internal.2.0.2 → 2.0.0-internal.2.1.0
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/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +6 -1
- package/dist/connectionManager.js.map +1 -1
- package/dist/container.d.ts +0 -1
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +2 -7
- package/dist/container.js.map +1 -1
- package/dist/deltaManager.d.ts +0 -2
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +1 -9
- package/dist/deltaManager.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/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js +7 -3
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +6 -1
- package/lib/connectionManager.js.map +1 -1
- package/lib/container.d.ts +0 -1
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +2 -7
- package/lib/container.js.map +1 -1
- package/lib/deltaManager.d.ts +0 -2
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +3 -11
- package/lib/deltaManager.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/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js +7 -3
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/package.json +15 -17
- package/src/connectionManager.ts +7 -1
- package/src/container.ts +2 -8
- package/src/deltaManager.ts +14 -28
- package/src/packageVersion.ts +1 -1
- package/src/retriableDocumentStorageService.ts +7 -3
package/src/container.ts
CHANGED
|
@@ -1526,7 +1526,7 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
|
|
|
1526
1526
|
// Some "warning" events come from outside the container and are logged
|
|
1527
1527
|
// elsewhere (e.g. summarizing container). We shouldn't log these here.
|
|
1528
1528
|
if (warn.logged !== true) {
|
|
1529
|
-
this.
|
|
1529
|
+
this.mc.logger.sendTelemetryEvent({ eventName: "ContainerWarning" }, warn);
|
|
1530
1530
|
}
|
|
1531
1531
|
this.emit("warning", warn);
|
|
1532
1532
|
});
|
|
@@ -1724,9 +1724,7 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
|
|
|
1724
1724
|
(type) => {
|
|
1725
1725
|
assert(this.activeConnection(),
|
|
1726
1726
|
0x241 /* "disconnect should result in stopSequenceNumberUpdate() call" */);
|
|
1727
|
-
|
|
1728
|
-
// ops whose contents are undefined
|
|
1729
|
-
this.submitMessage(type, null as any);
|
|
1727
|
+
this.submitMessage(type);
|
|
1730
1728
|
},
|
|
1731
1729
|
this.serviceConfiguration.noopTimeFrequency,
|
|
1732
1730
|
this.serviceConfiguration.noopCountFrequency,
|
|
@@ -1832,10 +1830,6 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
|
|
|
1832
1830
|
this.emit(dirty ? dirtyContainerEvent : savedContainerEvent);
|
|
1833
1831
|
}
|
|
1834
1832
|
|
|
1835
|
-
private logContainerError(warning: ContainerWarning) {
|
|
1836
|
-
this.mc.logger.sendErrorEvent({ eventName: "ContainerWarning" }, warning);
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
1833
|
/**
|
|
1840
1834
|
* Set the connected state of the ContainerContext
|
|
1841
1835
|
* This controls the "connected" state of the ContainerRuntime as well
|
package/src/deltaManager.ts
CHANGED
|
@@ -25,8 +25,6 @@ import {
|
|
|
25
25
|
normalizeError,
|
|
26
26
|
logIfFalse,
|
|
27
27
|
safeRaiseEvent,
|
|
28
|
-
MonitoringContext,
|
|
29
|
-
loggerToMonitoringContext,
|
|
30
28
|
} from "@fluidframework/telemetry-utils";
|
|
31
29
|
import {
|
|
32
30
|
IDocumentDeltaStorageService,
|
|
@@ -50,13 +48,12 @@ import {
|
|
|
50
48
|
DataCorruptionError,
|
|
51
49
|
extractSafePropertiesFromMessage,
|
|
52
50
|
DataProcessingError,
|
|
53
|
-
UsageError,
|
|
54
51
|
} from "@fluidframework/container-utils";
|
|
55
52
|
import { DeltaQueue } from "./deltaQueue";
|
|
56
53
|
import {
|
|
57
54
|
IConnectionManagerFactoryArgs,
|
|
58
55
|
IConnectionManager,
|
|
59
|
-
|
|
56
|
+
} from "./contracts";
|
|
60
57
|
|
|
61
58
|
export interface IConnectionArgs {
|
|
62
59
|
mode?: ConnectionMode;
|
|
@@ -112,15 +109,9 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
112
109
|
private pending: ISequencedDocumentMessage[] = [];
|
|
113
110
|
private fetchReason: string | undefined;
|
|
114
111
|
|
|
115
|
-
private readonly mc: MonitoringContext;
|
|
116
|
-
|
|
117
112
|
// A boolean used to assert that ops are not being sent while processing another op.
|
|
118
113
|
private currentlyProcessingOps: boolean = false;
|
|
119
114
|
|
|
120
|
-
// Feature gate that closes a container when sending an op if the container is
|
|
121
|
-
// concurrently processing another op
|
|
122
|
-
private readonly preventConcurrentOpSend: boolean = true;
|
|
123
|
-
|
|
124
115
|
// The minimum sequence number and last sequence number received from the server
|
|
125
116
|
private minSequenceNumber: number = 0;
|
|
126
117
|
|
|
@@ -205,7 +196,7 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
205
196
|
* Tells if current connection has checkpoint information.
|
|
206
197
|
* I.e. we know how far behind the client was at the time of establishing connection
|
|
207
198
|
*/
|
|
208
|
-
|
|
199
|
+
public get hasCheckpointSequenceNumber() {
|
|
209
200
|
// Valid to be called only if we have active connection.
|
|
210
201
|
assert(this.connectionManager.connected, 0x0df /* "Missing active connection" */);
|
|
211
202
|
return this._checkpointSequenceNumber !== undefined;
|
|
@@ -220,9 +211,6 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
220
211
|
public get clientDetails() { return this.connectionManager.clientDetails; }
|
|
221
212
|
|
|
222
213
|
public submit(type: MessageType, contents?: string, batch = false, metadata?: any) {
|
|
223
|
-
if (this.currentlyProcessingOps && this.preventConcurrentOpSend) {
|
|
224
|
-
this.close(new UsageError("Making changes to data model is disallowed while processing ops."));
|
|
225
|
-
}
|
|
226
214
|
const messagePartial: Omit<IDocumentMessage, "clientSequenceNumber"> = {
|
|
227
215
|
contents,
|
|
228
216
|
metadata,
|
|
@@ -240,7 +228,7 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
240
228
|
|
|
241
229
|
assert(isClientMessage(message), 0x419 /* client sends non-client message */);
|
|
242
230
|
|
|
243
|
-
if (contents !== undefined
|
|
231
|
+
if (contents !== undefined) {
|
|
244
232
|
this.opsSize += contents.length;
|
|
245
233
|
}
|
|
246
234
|
|
|
@@ -343,8 +331,6 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
343
331
|
};
|
|
344
332
|
|
|
345
333
|
this.connectionManager = createConnectionManager(props);
|
|
346
|
-
this.mc = loggerToMonitoringContext(logger);
|
|
347
|
-
this.preventConcurrentOpSend = this.mc.config.getBoolean("Fluid.Container.ConcurrentOpSend") === true;
|
|
348
334
|
this._inbound = new DeltaQueue<ISequencedDocumentMessage>(
|
|
349
335
|
(op) => {
|
|
350
336
|
this.processInboundMessage(op);
|
|
@@ -412,7 +398,7 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
412
398
|
if (checkpointSequenceNumber > this.lastQueuedSequenceNumber) {
|
|
413
399
|
this.fetchMissingDeltas("AfterConnection");
|
|
414
400
|
}
|
|
415
|
-
|
|
401
|
+
// we do not know the gap, and we will not learn about it if socket is quite - have to ask.
|
|
416
402
|
} else if (connection.mode === "read") {
|
|
417
403
|
this.fetchMissingDeltas("AfterReadConnection");
|
|
418
404
|
}
|
|
@@ -730,9 +716,9 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
730
716
|
// Report if we found some issues
|
|
731
717
|
if (duplicate !== 0 || gap !== 0 && !allowGaps || initialGap > 0 && this.fetchReason === undefined) {
|
|
732
718
|
eventName = "enqueueMessages";
|
|
733
|
-
|
|
719
|
+
// Also report if we are fetching ops, and same range comes in, thus making this fetch obsolete.
|
|
734
720
|
} else if (this.fetchReason !== undefined && this.fetchReason !== reason &&
|
|
735
|
-
|
|
721
|
+
(from <= this.lastQueuedSequenceNumber + 1 && last > this.lastQueuedSequenceNumber)) {
|
|
736
722
|
eventName = "enqueueMessagesExtraFetch";
|
|
737
723
|
}
|
|
738
724
|
|
|
@@ -893,15 +879,15 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
|
|
|
893
879
|
/**
|
|
894
880
|
* Retrieves the missing deltas between the given sequence numbers
|
|
895
881
|
*/
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
882
|
+
private fetchMissingDeltas(reasonArg: string, to?: number) {
|
|
883
|
+
this.fetchMissingDeltasCore(reasonArg, false /* cacheOnly */, to).catch((error) => {
|
|
884
|
+
this.logger.sendErrorEvent({ eventName: "fetchMissingDeltasException" }, error);
|
|
885
|
+
});
|
|
886
|
+
}
|
|
901
887
|
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
888
|
+
/**
|
|
889
|
+
* Retrieves the missing deltas between the given sequence numbers
|
|
890
|
+
*/
|
|
905
891
|
private async fetchMissingDeltasCore(
|
|
906
892
|
reason: string,
|
|
907
893
|
cacheOnly: boolean,
|
package/src/packageVersion.ts
CHANGED
|
@@ -104,12 +104,16 @@ export class RetriableDocumentStorageService implements IDocumentStorageService,
|
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
private checkStorageDisposed() {
|
|
107
|
+
private checkStorageDisposed(callName: string, error: unknown) {
|
|
108
108
|
if (this._disposed) {
|
|
109
|
+
this.logger.sendTelemetryEvent({
|
|
110
|
+
eventName: `${callName}_abortedStorageDisposed`,
|
|
111
|
+
fetchCallName: callName, // fetchCallName matches logs in runWithRetry.ts
|
|
112
|
+
}, error);
|
|
109
113
|
// pre-0.58 error message: storageServiceDisposedCannotRetry
|
|
110
114
|
throw new GenericError("Storage Service is disposed. Cannot retry", { canRetry: false });
|
|
111
115
|
}
|
|
112
|
-
return
|
|
116
|
+
return;
|
|
113
117
|
}
|
|
114
118
|
|
|
115
119
|
private async runWithRetry<T>(api: () => Promise<T>, callName: string): Promise<T> {
|
|
@@ -118,7 +122,7 @@ export class RetriableDocumentStorageService implements IDocumentStorageService,
|
|
|
118
122
|
callName,
|
|
119
123
|
this.logger,
|
|
120
124
|
{
|
|
121
|
-
onRetry: () => this.checkStorageDisposed(),
|
|
125
|
+
onRetry: (_delayInMs: number, error: unknown) => this.checkStorageDisposed(callName, error),
|
|
122
126
|
},
|
|
123
127
|
);
|
|
124
128
|
}
|