@fluidframework/container-loader 2.0.0-internal.5.1.1 → 2.0.0-internal.5.3.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/CHANGELOG.md +27 -0
- package/dist/catchUpMonitor.d.ts +1 -1
- package/dist/catchUpMonitor.d.ts.map +1 -1
- package/dist/catchUpMonitor.js.map +1 -1
- package/dist/connectionManager.d.ts +1 -1
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.d.ts +4 -1
- package/dist/connectionStateHandler.d.ts.map +1 -1
- package/dist/connectionStateHandler.js +10 -8
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +30 -31
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +182 -109
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +23 -66
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js +28 -213
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +1 -1
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +38 -6
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts +1 -3
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/deltaManager.d.ts +2 -1
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js.map +1 -1
- package/dist/disposal.d.ts +13 -0
- package/dist/disposal.d.ts.map +1 -0
- package/dist/disposal.js +25 -0
- package/dist/disposal.js.map +1 -0
- package/dist/loader.d.ts +1 -2
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js.map +1 -1
- package/dist/noopHeuristic.d.ts +23 -0
- package/dist/noopHeuristic.d.ts.map +1 -0
- package/dist/{collabWindowTracker.js → noopHeuristic.js} +30 -42
- package/dist/noopHeuristic.js.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/protocol.d.ts +7 -12
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +17 -19
- package/dist/protocol.js.map +1 -1
- package/dist/protocolTreeDocumentStorageService.d.ts +1 -1
- package/dist/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- package/dist/quorum.d.ts +1 -17
- package/dist/quorum.d.ts.map +1 -1
- package/dist/quorum.js +1 -17
- package/dist/quorum.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts +1 -1
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/lib/catchUpMonitor.d.ts +1 -1
- package/lib/catchUpMonitor.d.ts.map +1 -1
- package/lib/catchUpMonitor.js.map +1 -1
- package/lib/connectionManager.d.ts +1 -1
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.d.ts +4 -1
- package/lib/connectionStateHandler.d.ts.map +1 -1
- package/lib/connectionStateHandler.js +10 -8
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +30 -31
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +186 -113
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +23 -66
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js +28 -213
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +1 -1
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +38 -6
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts +1 -3
- package/lib/contracts.d.ts.map +1 -1
- package/lib/contracts.js.map +1 -1
- package/lib/deltaManager.d.ts +2 -1
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js.map +1 -1
- package/lib/disposal.d.ts +13 -0
- package/lib/disposal.d.ts.map +1 -0
- package/lib/disposal.js +21 -0
- package/lib/disposal.js.map +1 -0
- package/lib/loader.d.ts +1 -2
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js.map +1 -1
- package/lib/noopHeuristic.d.ts +23 -0
- package/lib/noopHeuristic.d.ts.map +1 -0
- package/lib/{collabWindowTracker.js → noopHeuristic.js} +30 -42
- package/lib/noopHeuristic.js.map +1 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/protocol.d.ts +7 -12
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +15 -18
- package/lib/protocol.js.map +1 -1
- package/lib/protocolTreeDocumentStorageService.d.ts +1 -1
- package/lib/protocolTreeDocumentStorageService.d.ts.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- package/lib/quorum.d.ts +1 -17
- package/lib/quorum.d.ts.map +1 -1
- package/lib/quorum.js +1 -16
- package/lib/quorum.js.map +1 -1
- package/lib/retriableDocumentStorageService.d.ts +1 -1
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/package.json +18 -14
- package/src/catchUpMonitor.ts +1 -1
- package/src/connectionManager.ts +1 -1
- package/src/connectionStateHandler.ts +15 -10
- package/src/container.ts +284 -139
- package/src/containerContext.ts +33 -335
- package/src/containerStorageAdapter.ts +47 -5
- package/src/contracts.ts +1 -3
- package/src/deltaManager.ts +15 -8
- package/src/disposal.ts +25 -0
- package/src/loader.ts +1 -1
- package/src/{collabWindowTracker.ts → noopHeuristic.ts} +37 -47
- package/src/packageVersion.ts +1 -1
- package/src/protocol.ts +18 -39
- package/src/protocolTreeDocumentStorageService.ts +1 -1
- package/src/quorum.ts +2 -31
- package/src/retriableDocumentStorageService.ts +2 -1
- package/dist/collabWindowTracker.d.ts +0 -19
- package/dist/collabWindowTracker.d.ts.map +0 -1
- package/dist/collabWindowTracker.js.map +0 -1
- package/dist/deltaManagerProxy.d.ts +0 -42
- package/dist/deltaManagerProxy.d.ts.map +0 -1
- package/dist/deltaManagerProxy.js +0 -79
- package/dist/deltaManagerProxy.js.map +0 -1
- package/lib/collabWindowTracker.d.ts +0 -19
- package/lib/collabWindowTracker.d.ts.map +0 -1
- package/lib/collabWindowTracker.js.map +0 -1
- package/lib/deltaManagerProxy.d.ts +0 -42
- package/lib/deltaManagerProxy.d.ts.map +0 -1
- package/lib/deltaManagerProxy.js +0 -74
- package/lib/deltaManagerProxy.js.map +0 -1
- package/src/deltaManagerProxy.ts +0 -109
|
@@ -3,13 +3,18 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert, Timer } from "@fluidframework/common-utils";
|
|
7
|
-
import { ISequencedDocumentMessage
|
|
8
|
-
import { isRuntimeMessage
|
|
6
|
+
import { assert, Timer, TypedEventEmitter } from "@fluidframework/common-utils";
|
|
7
|
+
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
|
+
import { isRuntimeMessage } from "@fluidframework/driver-utils";
|
|
9
|
+
import { IEvent } from "@fluidframework/common-definitions";
|
|
9
10
|
|
|
10
11
|
const defaultNoopTimeFrequency = 2000;
|
|
11
12
|
const defaultNoopCountFrequency = 50;
|
|
12
13
|
|
|
14
|
+
export interface INoopSenderEvents extends IEvent {
|
|
15
|
+
(event: "wantsNoop", listener: () => void);
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
// Here are key considerations when deciding conditions for when to send non-immediate noops:
|
|
14
19
|
// 1. Sending them too often results in increase in file size and bandwidth, as well as catch up performance
|
|
15
20
|
// 2. Sending too infrequently ensures that collab window is large, and as result Sequence DDS would have
|
|
@@ -29,21 +34,21 @@ const defaultNoopCountFrequency = 50;
|
|
|
29
34
|
// server timeout of 2000ms should be reconsidered to be increased.
|
|
30
35
|
// 2. If there are more than 50 ops received without sending any ops, send noop to keep collab window small.
|
|
31
36
|
// Note that system ops (including noops themselves) are excluded, so it's 1 noop per 50 real ops.
|
|
32
|
-
export class
|
|
33
|
-
private
|
|
37
|
+
export class NoopHeuristic extends TypedEventEmitter<INoopSenderEvents> {
|
|
38
|
+
private opsProcessedSinceOpSent = 0;
|
|
34
39
|
private readonly timer: Timer | undefined;
|
|
35
40
|
|
|
36
41
|
constructor(
|
|
37
|
-
private readonly submit: (type: MessageType) => void,
|
|
38
42
|
NoopTimeFrequency: number = defaultNoopTimeFrequency,
|
|
39
43
|
private readonly NoopCountFrequency: number = defaultNoopCountFrequency,
|
|
40
44
|
) {
|
|
45
|
+
super();
|
|
41
46
|
if (NoopTimeFrequency !== Infinity) {
|
|
42
47
|
this.timer = new Timer(NoopTimeFrequency, () => {
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
if (this.
|
|
46
|
-
this.
|
|
48
|
+
// We allow the timer to expire even if an op is sent or we disconnect.
|
|
49
|
+
// This condition is to guard against trying to send a noop anyway in that case.
|
|
50
|
+
if (this.opsProcessedSinceOpSent !== 0) {
|
|
51
|
+
this.emit("wantsNoop");
|
|
47
52
|
}
|
|
48
53
|
});
|
|
49
54
|
}
|
|
@@ -52,17 +57,7 @@ export class CollabWindowTracker {
|
|
|
52
57
|
/**
|
|
53
58
|
* Schedules as ack to the server to update the reference sequence number
|
|
54
59
|
*/
|
|
55
|
-
public
|
|
56
|
-
message: ISequencedDocumentMessage,
|
|
57
|
-
immediateNoOp: boolean,
|
|
58
|
-
): void {
|
|
59
|
-
// While processing a message, an immediate no-op can be requested.
|
|
60
|
-
// i.e. to expedite approve or commit phase of quorum.
|
|
61
|
-
if (immediateNoOp) {
|
|
62
|
-
this.submitNoop(true /* immediate */);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
60
|
+
public notifyMessageProcessed(message: ISequencedDocumentMessage): void {
|
|
66
61
|
// We don't acknowledge no-ops to avoid acknowledgement cycles (i.e. ack the MSN
|
|
67
62
|
// update, which updates the MSN, then ack the update, etc...).
|
|
68
63
|
// Intent here is for runtime (and DDSes) not to keep too much tracking state / memory
|
|
@@ -71,22 +66,27 @@ export class CollabWindowTracker {
|
|
|
71
66
|
return;
|
|
72
67
|
}
|
|
73
68
|
|
|
74
|
-
this.
|
|
75
|
-
if (this.
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
69
|
+
this.opsProcessedSinceOpSent++;
|
|
70
|
+
if (this.opsProcessedSinceOpSent === this.NoopCountFrequency) {
|
|
71
|
+
// Wait to send a noop if we are still synchronously processing ops. This guards against two things:
|
|
72
|
+
// 1. If we're processing many ops, we may pass the frequency threshold many times. We only need to send one noop at the very end in this case.
|
|
73
|
+
// 2. We may send another (non-noop) op in response to processing those ops, e.g. an Accept op.
|
|
74
|
+
queueMicrotask(() => {
|
|
75
|
+
if (this.opsProcessedSinceOpSent >= this.NoopCountFrequency) {
|
|
76
|
+
this.emit("wantsNoop");
|
|
77
|
+
assert(
|
|
78
|
+
this.opsProcessedSinceOpSent === 0,
|
|
79
|
+
0x243 /* "Expected a noop to be synchronously sent" */,
|
|
80
|
+
);
|
|
83
81
|
}
|
|
84
82
|
return;
|
|
85
83
|
});
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
if (this.timer !== undefined) {
|
|
89
|
-
if
|
|
87
|
+
// Start the timer if we newly have ops that want a noop.
|
|
88
|
+
// If the timer was already running (e.g. we surpassed the op count and sent a noop) this will reset it to its full duration.
|
|
89
|
+
if (this.opsProcessedSinceOpSent === 1) {
|
|
90
90
|
this.timer.restart();
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -94,23 +94,13 @@ export class CollabWindowTracker {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
//
|
|
99
|
-
|
|
100
|
-
this.submit(immediate ? (MessageType2.Accept as unknown as MessageType) : MessageType.NoOp);
|
|
101
|
-
assert(
|
|
102
|
-
this.opsCountSinceNoop === 0,
|
|
103
|
-
0x243 /* "stopSequenceNumberUpdate should be called as result of sending any op!" */,
|
|
104
|
-
);
|
|
97
|
+
public notifyDisconnect(): void {
|
|
98
|
+
// No need to noop for any ops processed prior to disconnect - we are already removed from MSN calculation.
|
|
99
|
+
this.opsProcessedSinceOpSent = 0;
|
|
105
100
|
}
|
|
106
101
|
|
|
107
|
-
public
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
// keeps sending ops. In most cases it's actually better to let it expire (at most - 4 times per second)
|
|
111
|
-
// for nothing, then have a ton of set/reset cycles.
|
|
112
|
-
// Note that Timer.restart() is smart and will not change timer expiration if we keep extending timer
|
|
113
|
-
// expiration - it will restart the timer instead when it fires with adjusted expiration.
|
|
114
|
-
// this.timer.clear();
|
|
102
|
+
public notifyMessageSent(): void {
|
|
103
|
+
// Sending any message is as good as a noop for updating MSN.
|
|
104
|
+
this.opsProcessedSinceOpSent = 0;
|
|
115
105
|
}
|
|
116
106
|
}
|
package/src/packageVersion.ts
CHANGED
package/src/protocol.ts
CHANGED
|
@@ -11,14 +11,9 @@ import {
|
|
|
11
11
|
} from "@fluidframework/protocol-base";
|
|
12
12
|
import {
|
|
13
13
|
IDocumentAttributes,
|
|
14
|
-
IProcessMessageResult,
|
|
15
|
-
ISequencedClient,
|
|
16
|
-
ISequencedDocumentMessage,
|
|
17
14
|
ISignalClient,
|
|
18
15
|
ISignalMessage,
|
|
19
|
-
MessageType,
|
|
20
16
|
} from "@fluidframework/protocol-definitions";
|
|
21
|
-
import { canBeCoalescedByService } from "@fluidframework/driver-utils";
|
|
22
17
|
|
|
23
18
|
// "term" was an experimental feature that is being removed. The only safe value to use is 1.
|
|
24
19
|
export const OnlyValidTermValue = 1 as const;
|
|
@@ -30,17 +25,6 @@ export enum SignalType {
|
|
|
30
25
|
Clear = "clear", // used only by client for synthetic signals
|
|
31
26
|
}
|
|
32
27
|
|
|
33
|
-
/**
|
|
34
|
-
* ADO: #4277: ConnectionStateHandler can mutate Quorum members, but shouldn't
|
|
35
|
-
* This interface might go away after the above ADO item is done
|
|
36
|
-
*/
|
|
37
|
-
export interface ILocalSequencedClient extends ISequencedClient {
|
|
38
|
-
/**
|
|
39
|
-
* True if the client should have left the quorum, false otherwise
|
|
40
|
-
*/
|
|
41
|
-
shouldHaveLeft?: boolean;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
28
|
/**
|
|
45
29
|
* Function to be used for creating a protocol handler.
|
|
46
30
|
*/
|
|
@@ -82,29 +66,6 @@ export class ProtocolHandler extends ProtocolOpHandler implements IProtocolHandl
|
|
|
82
66
|
}
|
|
83
67
|
}
|
|
84
68
|
|
|
85
|
-
public processMessage(
|
|
86
|
-
message: ISequencedDocumentMessage,
|
|
87
|
-
local: boolean,
|
|
88
|
-
): IProcessMessageResult {
|
|
89
|
-
const client: ILocalSequencedClient | undefined = this.quorum.getMember(message.clientId);
|
|
90
|
-
|
|
91
|
-
// Check and report if we're getting messages from a clientId that we previously
|
|
92
|
-
// flagged as shouldHaveLeft, or from a client that's not in the quorum but should be
|
|
93
|
-
if (message.clientId != null) {
|
|
94
|
-
if (client === undefined && message.type !== MessageType.ClientJoin) {
|
|
95
|
-
// pre-0.58 error message: messageClientIdMissingFromQuorum
|
|
96
|
-
throw new Error("Remote message's clientId is missing from the quorum");
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (client?.shouldHaveLeft === true && !canBeCoalescedByService(message)) {
|
|
100
|
-
// pre-0.58 error message: messageClientIdShouldHaveLeft
|
|
101
|
-
throw new Error("Remote message's clientId already should have left");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return super.processMessage(message, local);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
69
|
public processSignal(message: ISignalMessage) {
|
|
109
70
|
const innerContent = message.content as { content: any; type: string };
|
|
110
71
|
switch (innerContent.type) {
|
|
@@ -138,3 +99,21 @@ export class ProtocolHandler extends ProtocolOpHandler implements IProtocolHandl
|
|
|
138
99
|
}
|
|
139
100
|
}
|
|
140
101
|
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Function to check whether the protocol handler should process the Signal.
|
|
105
|
+
* The protocol handler should strictly handle only ClientJoin, ClientLeave
|
|
106
|
+
* and Clear signal types.
|
|
107
|
+
*/
|
|
108
|
+
export function protocolHandlerShouldProcessSignal(message: ISignalMessage) {
|
|
109
|
+
// Signal originates from server
|
|
110
|
+
if (message.clientId === null) {
|
|
111
|
+
const innerContent = message.content as { content: unknown; type: string };
|
|
112
|
+
return (
|
|
113
|
+
innerContent.type === SignalType.Clear ||
|
|
114
|
+
innerContent.type === SignalType.ClientJoin ||
|
|
115
|
+
innerContent.type === SignalType.ClientLeave
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IDisposable } from "@fluidframework/
|
|
6
|
+
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { IDocumentStorageService, ISummaryContext } from "@fluidframework/driver-definitions";
|
|
8
8
|
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
9
9
|
|
package/src/quorum.ts
CHANGED
|
@@ -2,38 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { assert
|
|
5
|
+
import { assert } from "@fluidframework/common-utils";
|
|
6
6
|
import { IFluidCodeDetails } from "@fluidframework/core-interfaces";
|
|
7
|
-
import {
|
|
8
|
-
ICommittedProposal,
|
|
9
|
-
IQuorum,
|
|
10
|
-
IQuorumEvents,
|
|
11
|
-
ISequencedClient,
|
|
12
|
-
} from "@fluidframework/protocol-definitions";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Proxies Quorum events.
|
|
16
|
-
*/
|
|
17
|
-
export class QuorumProxy extends EventForwarder<IQuorumEvents> implements IQuorum {
|
|
18
|
-
public readonly propose: (key: string, value: any) => Promise<void>;
|
|
19
|
-
public readonly has: (key: string) => boolean;
|
|
20
|
-
public readonly get: (key: string) => any;
|
|
21
|
-
public readonly getMembers: () => Map<string, ISequencedClient>;
|
|
22
|
-
public readonly getMember: (clientId: string) => ISequencedClient | undefined;
|
|
23
|
-
|
|
24
|
-
constructor(quorum: IQuorum) {
|
|
25
|
-
super(quorum);
|
|
26
|
-
|
|
27
|
-
// This is heavily used object, increase limit at which Node prints warnings.
|
|
28
|
-
super.setMaxListeners(50);
|
|
29
|
-
|
|
30
|
-
this.propose = doIfNotDisposed(this, quorum.propose.bind(quorum));
|
|
31
|
-
this.has = doIfNotDisposed(this, quorum.has.bind(quorum));
|
|
32
|
-
this.get = doIfNotDisposed(this, quorum.get.bind(quorum));
|
|
33
|
-
this.getMembers = doIfNotDisposed(this, quorum.getMembers.bind(quorum));
|
|
34
|
-
this.getMember = doIfNotDisposed(this, quorum.getMember.bind(quorum));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
7
|
+
import { ICommittedProposal } from "@fluidframework/protocol-definitions";
|
|
37
8
|
|
|
38
9
|
export function getCodeDetailsFromQuorumValues(
|
|
39
10
|
quorumValues: [string, ICommittedProposal][],
|
|
@@ -18,7 +18,8 @@ import {
|
|
|
18
18
|
ISummaryTree,
|
|
19
19
|
IVersion,
|
|
20
20
|
} from "@fluidframework/protocol-definitions";
|
|
21
|
-
import { IDisposable } from "@fluidframework/
|
|
21
|
+
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
22
|
+
|
|
22
23
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
23
24
|
import { runWithRetry } from "@fluidframework/driver-utils";
|
|
24
25
|
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
6
|
-
export declare class CollabWindowTracker {
|
|
7
|
-
private readonly submit;
|
|
8
|
-
private readonly NoopCountFrequency;
|
|
9
|
-
private opsCountSinceNoop;
|
|
10
|
-
private readonly timer;
|
|
11
|
-
constructor(submit: (type: MessageType) => void, NoopTimeFrequency?: number, NoopCountFrequency?: number);
|
|
12
|
-
/**
|
|
13
|
-
* Schedules as ack to the server to update the reference sequence number
|
|
14
|
-
*/
|
|
15
|
-
scheduleSequenceNumberUpdate(message: ISequencedDocumentMessage, immediateNoOp: boolean): void;
|
|
16
|
-
private submitNoop;
|
|
17
|
-
stopSequenceNumberUpdate(): void;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=collabWindowTracker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collabWindowTracker.d.ts","sourceRoot":"","sources":["../src/collabWindowTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAyB9F,qBAAa,mBAAmB;IAK9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IANpC,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;gBAGxB,MAAM,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,EACpD,iBAAiB,GAAE,MAAiC,EACnC,kBAAkB,GAAE,MAAkC;IAaxE;;OAEG;IACI,4BAA4B,CAClC,OAAO,EAAE,yBAAyB,EAClC,aAAa,EAAE,OAAO,GACpB,IAAI;IAuCP,OAAO,CAAC,UAAU;IAUX,wBAAwB,IAAI,IAAI;CASvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coll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ent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Timer } from \"@fluidframework/common-utils\";\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport { isRuntimeMessage, MessageType2 } from \"@fluidframework/driver-utils\";\n\nconst defaultNoopTimeFrequency = 2000;\nconst defaultNoopCountFrequency = 50;\n\n// Here are key considerations when deciding conditions for when to send non-immediate noops:\n// 1. Sending them too often results in increase in file size and bandwidth, as well as catch up performance\n// 2. Sending too infrequently ensures that collab window is large, and as result Sequence DDS would have\n// large catchUp blobs - see Issue #6364\n// 3. Similarly, processes that rely on \"core\" snapshot (and can't parse trailing ops, including above), like search\n// parser in SPO, will result in non-accurate results due to presence of catch up blobs.\n// 4. Ordering service used 250ms timeout to coalesce non-immediate noops. It was changed to 2000 ms to allow more\n// aggressive noop sending from client side.\n// 5. Number of ops sent by all clients is proportional to number of \"write\" clients (every client sends noops),\n// but number of sequenced noops is a function of time (one op per 2 seconds at most).\n// We should consider impact to both outbound traffic (might be huge, depends on number of clients) and file size.\n// Please also see Issue #5629 for more discussions.\n//\n// With that, the current algorithm is as follows:\n// 1. Sent noop 2000 ms of receiving an op if no ops were sent by this client within this timeframe.\n// This will ensure that MSN moves forward with reasonable speed. If that results in too many sequenced noops,\n// server timeout of 2000ms should be reconsidered to be increased.\n// 2. If there are more than 50 ops received without sending any ops, send noop to keep collab window small.\n// Note that system ops (including noops themselves) are excluded, so it's 1 noop per 50 real ops.\nexport class CollabWindowTracker {\n\tprivate opsCountSinceNoop = 0;\n\tprivate readonly timer: Timer | undefined;\n\n\tconstructor(\n\t\tprivate readonly submit: (type: MessageType) => void,\n\t\tNoopTimeFrequency: number = defaultNoopTimeFrequency,\n\t\tprivate readonly NoopCountFrequency: number = defaultNoopCountFrequency,\n\t) {\n\t\tif (NoopTimeFrequency !== Infinity) {\n\t\t\tthis.timer = new Timer(NoopTimeFrequency, () => {\n\t\t\t\t// Can get here due to this.stopSequenceNumberUpdate() not resetting timer.\n\t\t\t\t// Also timer callback can fire even after timer cancellation if it was queued before cancellation.\n\t\t\t\tif (this.opsCountSinceNoop !== 0) {\n\t\t\t\t\tthis.submitNoop(false /* immediate */);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Schedules as ack to the server to update the reference sequence number\n\t */\n\tpublic scheduleSequenceNumberUpdate(\n\t\tmessage: ISequencedDocumentMessage,\n\t\timmediateNoOp: boolean,\n\t): void {\n\t\t// While processing a message, an immediate no-op can be requested.\n\t\t// i.e. to expedite approve or commit phase of quorum.\n\t\tif (immediateNoOp) {\n\t\t\tthis.submitNoop(true /* immediate */);\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't acknowledge no-ops to avoid acknowledgement cycles (i.e. ack the MSN\n\t\t// update, which updates the MSN, then ack the update, etc...).\n\t\t// Intent here is for runtime (and DDSes) not to keep too much tracking state / memory\n\t\t// due to runtime ops from other clients.\n\t\tif (!isRuntimeMessage(message)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.opsCountSinceNoop++;\n\t\tif (this.opsCountSinceNoop === this.NoopCountFrequency) {\n\t\t\t// Ensure we only send noop after a batch of many ops is processed\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tif (this.opsCountSinceNoop >= this.NoopCountFrequency) {\n\t\t\t\t\tthis.submitNoop(false /* immediate */);\n\t\t\t\t\t// reset count now that all ops are processed\n\t\t\t\t\tthis.opsCountSinceNoop = 0;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t});\n\t\t}\n\n\t\tif (this.timer !== undefined) {\n\t\t\tif (this.opsCountSinceNoop === 1) {\n\t\t\t\tthis.timer.restart();\n\t\t\t}\n\n\t\t\tassert(this.timer.hasTimer, 0x242 /* \"has timer\" */);\n\t\t}\n\t}\n\n\tprivate submitNoop(immediate: boolean) {\n\t\t// Anything other than null is immediate noop\n\t\t// ADO:1385: Remove cast and use MessageType once definition changes propagate\n\t\tthis.submit(immediate ? (MessageType2.Accept as unknown as MessageType) : MessageType.NoOp);\n\t\tassert(\n\t\t\tthis.opsCountSinceNoop === 0,\n\t\t\t0x243 /* \"stopSequenceNumberUpdate should be called as result of sending any op!\" */,\n\t\t);\n\t}\n\n\tpublic stopSequenceNumberUpdate(): void {\n\t\tthis.opsCountSinceNoop = 0;\n\t\t// Ideally, we cancel timer here. But that will result in too often set/reset cycle if this client\n\t\t// keeps sending ops. In most cases it's actually better to let it expire (at most - 4 times per second)\n\t\t// for nothing, then have a ton of set/reset cycles.\n\t\t// Note that Timer.restart() is smart and will not change timer expiration if we keep extending timer\n\t\t// expiration - it will restart the timer instead when it fires with adjusted expiration.\n\t\t// this.timer.clear();\n\t}\n}\n"]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IDeltaManager, IDeltaQueue, IDeltaQueueEvents } from "@fluidframework/container-definitions";
|
|
6
|
-
import { EventForwarder } from "@fluidframework/common-utils";
|
|
7
|
-
import { IDocumentMessage, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { DeltaManagerProxyBase } from "@fluidframework/container-utils";
|
|
9
|
-
/**
|
|
10
|
-
* Proxy to the real IDeltaQueue - used to restrict access
|
|
11
|
-
*/
|
|
12
|
-
export declare class DeltaQueueProxy<T> extends EventForwarder<IDeltaQueueEvents<T>> implements IDeltaQueue<T> {
|
|
13
|
-
private readonly queue;
|
|
14
|
-
get paused(): boolean;
|
|
15
|
-
get length(): number;
|
|
16
|
-
get idle(): boolean;
|
|
17
|
-
constructor(queue: IDeltaQueue<T>);
|
|
18
|
-
peek(): T | undefined;
|
|
19
|
-
toArray(): T[];
|
|
20
|
-
systemPause(): Promise<void>;
|
|
21
|
-
pause(): Promise<void>;
|
|
22
|
-
systemResume(): Promise<void>;
|
|
23
|
-
resume(): Promise<void>;
|
|
24
|
-
waitTillProcessingDone(): Promise<{
|
|
25
|
-
count: number;
|
|
26
|
-
duration: number;
|
|
27
|
-
}>;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Proxy to the real IDeltaManager - used to restrict access
|
|
31
|
-
*/
|
|
32
|
-
export declare class DeltaManagerProxy extends DeltaManagerProxyBase implements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {
|
|
33
|
-
get inbound(): IDeltaQueue<ISequencedDocumentMessage>;
|
|
34
|
-
private readonly _inbound;
|
|
35
|
-
get outbound(): IDeltaQueue<IDocumentMessage[]>;
|
|
36
|
-
private readonly _outbound;
|
|
37
|
-
get inboundSignal(): IDeltaQueue<ISignalMessage>;
|
|
38
|
-
private readonly _inboundSignal;
|
|
39
|
-
constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>);
|
|
40
|
-
dispose(): void;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=deltaManagerProxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deltaManagerProxy.d.ts","sourceRoot":"","sources":["../src/deltaManagerProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EACN,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE;;GAEG;AACH,qBAAa,eAAe,CAAC,CAAC,CAC7B,SAAQ,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAC3C,YAAW,WAAW,CAAC,CAAC,CAAC;IAcb,OAAO,CAAC,QAAQ,CAAC,KAAK;IAZlC,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,IAAI,IAAI,OAAO,CAEzB;gBAE4B,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAI3C,IAAI,IAAI,CAAC,GAAG,SAAS;IAIrB,OAAO,IAAI,CAAC,EAAE;IAKR,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,sBAAsB;;;;CAGnC;AAED;;GAEG;AACH,qBAAa,iBACZ,SAAQ,qBACR,YAAW,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC;IAErE,IAAW,OAAO,IAAI,WAAW,CAAC,yBAAyB,CAAC,CAE3D;IACD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyC;IAElE,IAAW,QAAQ,IAAI,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAErD;IACD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkC;IAE5D,IAAW,aAAa,IAAI,WAAW,CAAC,cAAc,CAAC,CAEtD;IACD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA8B;gBAEjD,YAAY,EAAE,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC;IAQ7E,OAAO,IAAI,IAAI;CAMtB"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.DeltaManagerProxy = exports.DeltaQueueProxy = void 0;
|
|
8
|
-
const common_utils_1 = require("@fluidframework/common-utils");
|
|
9
|
-
const container_utils_1 = require("@fluidframework/container-utils");
|
|
10
|
-
/**
|
|
11
|
-
* Proxy to the real IDeltaQueue - used to restrict access
|
|
12
|
-
*/
|
|
13
|
-
class DeltaQueueProxy extends common_utils_1.EventForwarder {
|
|
14
|
-
constructor(queue) {
|
|
15
|
-
super(queue);
|
|
16
|
-
this.queue = queue;
|
|
17
|
-
}
|
|
18
|
-
get paused() {
|
|
19
|
-
return this.queue.paused;
|
|
20
|
-
}
|
|
21
|
-
get length() {
|
|
22
|
-
return this.queue.length;
|
|
23
|
-
}
|
|
24
|
-
get idle() {
|
|
25
|
-
return this.queue.idle;
|
|
26
|
-
}
|
|
27
|
-
peek() {
|
|
28
|
-
return this.queue.peek();
|
|
29
|
-
}
|
|
30
|
-
toArray() {
|
|
31
|
-
return this.queue.toArray();
|
|
32
|
-
}
|
|
33
|
-
// back-compat: usage removed in 0.33, remove in future versions
|
|
34
|
-
async systemPause() {
|
|
35
|
-
return this.pause();
|
|
36
|
-
}
|
|
37
|
-
async pause() {
|
|
38
|
-
return this.queue.pause();
|
|
39
|
-
}
|
|
40
|
-
// back-compat: usage removed in 0.33, remove in future versions
|
|
41
|
-
async systemResume() {
|
|
42
|
-
return this.resume();
|
|
43
|
-
}
|
|
44
|
-
async resume() {
|
|
45
|
-
this.queue.resume();
|
|
46
|
-
}
|
|
47
|
-
async waitTillProcessingDone() {
|
|
48
|
-
return this.queue.waitTillProcessingDone();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.DeltaQueueProxy = DeltaQueueProxy;
|
|
52
|
-
/**
|
|
53
|
-
* Proxy to the real IDeltaManager - used to restrict access
|
|
54
|
-
*/
|
|
55
|
-
class DeltaManagerProxy extends container_utils_1.DeltaManagerProxyBase {
|
|
56
|
-
constructor(deltaManager) {
|
|
57
|
-
super(deltaManager);
|
|
58
|
-
this._inbound = new DeltaQueueProxy(deltaManager.inbound);
|
|
59
|
-
this._outbound = new DeltaQueueProxy(deltaManager.outbound);
|
|
60
|
-
this._inboundSignal = new DeltaQueueProxy(deltaManager.inboundSignal);
|
|
61
|
-
}
|
|
62
|
-
get inbound() {
|
|
63
|
-
return this._inbound;
|
|
64
|
-
}
|
|
65
|
-
get outbound() {
|
|
66
|
-
return this._outbound;
|
|
67
|
-
}
|
|
68
|
-
get inboundSignal() {
|
|
69
|
-
return this._inboundSignal;
|
|
70
|
-
}
|
|
71
|
-
dispose() {
|
|
72
|
-
this._inbound.dispose();
|
|
73
|
-
this._outbound.dispose();
|
|
74
|
-
this._inboundSignal.dispose();
|
|
75
|
-
super.dispose();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.DeltaManagerProxy = DeltaManagerProxy;
|
|
79
|
-
//# sourceMappingURL=deltaManagerProxy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deltaManagerProxy.js","sourceRoot":"","sources":["../src/deltaManagerProxy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,+DAA8D;AAM9D,qEAAwE;AAExE;;GAEG;AACH,MAAa,eACZ,SAAQ,6BAAoC;IAe5C,YAA6B,KAAqB;QACjD,KAAK,CAAC,KAAK,CAAC,CAAC;QADe,UAAK,GAAL,KAAK,CAAgB;IAElD,CAAC;IAdD,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,IAAW,IAAI;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACxB,CAAC;IAMM,IAAI;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAEM,OAAO;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,gEAAgE;IACzD,KAAK,CAAC,WAAW;QACvB,OAAO,IAAI,CAAC,K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ation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDeltaManager,\n\tIDeltaQueue,\n\tIDeltaQueueEvents,\n} from \"@fluidframework/container-definitions\";\nimport { EventForwarder } from \"@fluidframework/common-utils\";\nimport {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport { DeltaManagerProxyBase } from \"@fluidframework/container-utils\";\n\n/**\n * Proxy to the real IDeltaQueue - used to restrict access\n */\nexport class DeltaQueueProxy<T>\n\textends EventForwarder<IDeltaQueueEvents<T>>\n\timplements IDeltaQueue<T>\n{\n\tpublic get paused(): boolean {\n\t\treturn this.queue.paused;\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.queue.length;\n\t}\n\n\tpublic get idle(): boolean {\n\t\treturn this.queue.idle;\n\t}\n\n\tconstructor(private readonly queue: IDeltaQueue<T>) {\n\t\tsuper(queue);\n\t}\n\n\tpublic peek(): T | undefined {\n\t\treturn this.queue.peek();\n\t}\n\n\tpublic toArray(): T[] {\n\t\treturn this.queue.toArray();\n\t}\n\n\t// back-compat: usage removed in 0.33, remove in future versions\n\tpublic async systemPause(): Promise<void> {\n\t\treturn this.pause();\n\t}\n\n\tpublic async pause(): Promise<void> {\n\t\treturn this.queue.pause();\n\t}\n\n\t// back-compat: usage removed in 0.33, remove in future versions\n\tpublic async systemResume(): Promise<void> {\n\t\treturn this.resume();\n\t}\n\n\tpublic async resume(): Promise<void> {\n\t\tthis.queue.resume();\n\t}\n\n\tpublic async waitTillProcessingDone() {\n\t\treturn this.queue.waitTillProcessingDone();\n\t}\n}\n\n/**\n * Proxy to the real IDeltaManager - used to restrict access\n */\nexport class DeltaManagerProxy\n\textends DeltaManagerProxyBase\n\timplements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n{\n\tpublic get inbound(): IDeltaQueue<ISequencedDocumentMessage> {\n\t\treturn this._inbound;\n\t}\n\tprivate readonly _inbound: IDeltaQueue<ISequencedDocumentMessage>;\n\n\tpublic get outbound(): IDeltaQueue<IDocumentMessage[]> {\n\t\treturn this._outbound;\n\t}\n\tprivate readonly _outbound: IDeltaQueue<IDocumentMessage[]>;\n\n\tpublic get inboundSignal(): IDeltaQueue<ISignalMessage> {\n\t\treturn this._inboundSignal;\n\t}\n\tprivate readonly _inboundSignal: IDeltaQueue<ISignalMessage>;\n\n\tconstructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>) {\n\t\tsuper(deltaManager);\n\n\t\tthis._inbound = new DeltaQueueProxy(deltaManager.inbound);\n\t\tthis._outbound = new DeltaQueueProxy(deltaManager.outbound);\n\t\tthis._inboundSignal = new DeltaQueueProxy(deltaManager.inboundSignal);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._inbound.dispose();\n\t\tthis._outbound.dispose();\n\t\tthis._inboundSignal.dispose();\n\t\tsuper.dispose();\n\t}\n}\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
6
|
-
export declare class CollabWindowTracker {
|
|
7
|
-
private readonly submit;
|
|
8
|
-
private readonly NoopCountFrequency;
|
|
9
|
-
private opsCountSinceNoop;
|
|
10
|
-
private readonly timer;
|
|
11
|
-
constructor(submit: (type: MessageType) => void, NoopTimeFrequency?: number, NoopCountFrequency?: number);
|
|
12
|
-
/**
|
|
13
|
-
* Schedules as ack to the server to update the reference sequence number
|
|
14
|
-
*/
|
|
15
|
-
scheduleSequenceNumberUpdate(message: ISequencedDocumentMessage, immediateNoOp: boolean): void;
|
|
16
|
-
private submitNoop;
|
|
17
|
-
stopSequenceNumberUpdate(): void;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=collabWindowTracker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collabWindowTracker.d.ts","sourceRoot":"","sources":["../src/collabWindowTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAyB9F,qBAAa,mBAAmB;IAK9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IANpC,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;gBAGxB,MAAM,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,EACpD,iBAAiB,GAAE,MAAiC,EACnC,kBAAkB,GAAE,MAAkC;IAaxE;;OAEG;IACI,4BAA4B,CAClC,OAAO,EAAE,yBAAyB,EAClC,aAAa,EAAE,OAAO,GACpB,IAAI;IAuCP,OAAO,CAAC,UAAU;IAUX,wBAAwB,IAAI,IAAI;CASvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collabWindowTracker.js","sourceRoot":"","sources":["../src/collabWindowTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAA6B,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE9E,MAAM,wBAAwB,GAAG,IAAI,CAAC;AACtC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAErC,6FAA6F;AAC7F,4GAA4G;AAC5G,yGAAyG;AACzG,2CAA2C;AAC3C,oHAAoH;AACpH,2FAA2F;AAC3F,kHAAkH;AAClH,+CAA+C;AAC/C,gHAAgH;AAChH,yFAAyF;AACzF,qHAAqH;AACrH,oDAAoD;AACpD,EAAE;AACF,kDAAkD;AAClD,oGAAoG;AACpG,iHAA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,CAAC,CAAC;iBAC3B;gBACD,OAAO;YACR,CAAC,CAAC,CAAC;SACH;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC7B,IAAI,IAAI,CAAC,iBAAiB,KAAK,CAAC,EAAE;gBACjC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;aACrB;YAED,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;SACrD;IACF,CAAC;IAEO,UAAU,CAAC,SAAkB;QACpC,6CAA6C;QAC7C,8EAA8E;QAC9E,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAE,YAAY,CAAC,MAAiC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC5F,MAAM,CACL,IAAI,CAAC,iBAAiB,KAAK,CAAC,EAC5B,KAAK,CAAC,8EAA8E,CACpF,CAAC;IACH,CAAC;IAEM,wBAAwB;QAC9B,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;QAC3B,kGAAkG;QAClG,wGAAwG;QACxG,oDAAoD;QACpD,qGAAqG;QACrG,yFAAyF;QACzF,sBAAsB;IACvB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Timer } from \"@fluidframework/common-utils\";\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport { isRuntimeMessage, MessageType2 } from \"@fluidframework/driver-utils\";\n\nconst defaultNoopTimeFrequency = 2000;\nconst defaultNoopCountFrequency = 50;\n\n// Here are key considerations when deciding conditions for when to send non-immediate noops:\n// 1. Sending them too often results in increase in file size and bandwidth, as well as catch up performance\n// 2. Sending too infrequently ensures that collab window is large, and as result Sequence DDS would have\n// large catchUp blobs - see Issue #6364\n// 3. Similarly, processes that rely on \"core\" snapshot (and can't parse trailing ops, including above), like search\n// parser in SPO, will result in non-accurate results due to presence of catch up blobs.\n// 4. Ordering service used 250ms timeout to coalesce non-immediate noops. It was changed to 2000 ms to allow more\n// aggressive noop sending from client side.\n// 5. Number of ops sent by all clients is proportional to number of \"write\" clients (every client sends noops),\n// but number of sequenced noops is a function of time (one op per 2 seconds at most).\n// We should consider impact to both outbound traffic (might be huge, depends on number of clients) and file size.\n// Please also see Issue #5629 for more discussions.\n//\n// With that, the current algorithm is as follows:\n// 1. Sent noop 2000 ms of receiving an op if no ops were sent by this client within this timeframe.\n// This will ensure that MSN moves forward with reasonable speed. If that results in too many sequenced noops,\n// server timeout of 2000ms should be reconsidered to be increased.\n// 2. If there are more than 50 ops received without sending any ops, send noop to keep collab window small.\n// Note that system ops (including noops themselves) are excluded, so it's 1 noop per 50 real ops.\nexport class CollabWindowTracker {\n\tprivate opsCountSinceNoop = 0;\n\tprivate readonly timer: Timer | undefined;\n\n\tconstructor(\n\t\tprivate readonly submit: (type: MessageType) => void,\n\t\tNoopTimeFrequency: number = defaultNoopTimeFrequency,\n\t\tprivate readonly NoopCountFrequency: number = defaultNoopCountFrequency,\n\t) {\n\t\tif (NoopTimeFrequency !== Infinity) {\n\t\t\tthis.timer = new Timer(NoopTimeFrequency, () => {\n\t\t\t\t// Can get here due to this.stopSequenceNumberUpdate() not resetting timer.\n\t\t\t\t// Also timer callback can fire even after timer cancellation if it was queued before cancellation.\n\t\t\t\tif (this.opsCountSinceNoop !== 0) {\n\t\t\t\t\tthis.submitNoop(false /* immediate */);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Schedules as ack to the server to update the reference sequence number\n\t */\n\tpublic scheduleSequenceNumberUpdate(\n\t\tmessage: ISequencedDocumentMessage,\n\t\timmediateNoOp: boolean,\n\t): void {\n\t\t// While processing a message, an immediate no-op can be requested.\n\t\t// i.e. to expedite approve or commit phase of quorum.\n\t\tif (immediateNoOp) {\n\t\t\tthis.submitNoop(true /* immediate */);\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't acknowledge no-ops to avoid acknowledgement cycles (i.e. ack the MSN\n\t\t// update, which updates the MSN, then ack the update, etc...).\n\t\t// Intent here is for runtime (and DDSes) not to keep too much tracking state / memory\n\t\t// due to runtime ops from other clients.\n\t\tif (!isRuntimeMessage(message)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.opsCountSinceNoop++;\n\t\tif (this.opsCountSinceNoop === this.NoopCountFrequency) {\n\t\t\t// Ensure we only send noop after a batch of many ops is processed\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tif (this.opsCountSinceNoop >= this.NoopCountFrequency) {\n\t\t\t\t\tthis.submitNoop(false /* immediate */);\n\t\t\t\t\t// reset count now that all ops are processed\n\t\t\t\t\tthis.opsCountSinceNoop = 0;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t});\n\t\t}\n\n\t\tif (this.timer !== undefined) {\n\t\t\tif (this.opsCountSinceNoop === 1) {\n\t\t\t\tthis.timer.restart();\n\t\t\t}\n\n\t\t\tassert(this.timer.hasTimer, 0x242 /* \"has timer\" */);\n\t\t}\n\t}\n\n\tprivate submitNoop(immediate: boolean) {\n\t\t// Anything other than null is immediate noop\n\t\t// ADO:1385: Remove cast and use MessageType once definition changes propagate\n\t\tthis.submit(immediate ? (MessageType2.Accept as unknown as MessageType) : MessageType.NoOp);\n\t\tassert(\n\t\t\tthis.opsCountSinceNoop === 0,\n\t\t\t0x243 /* \"stopSequenceNumberUpdate should be called as result of sending any op!\" */,\n\t\t);\n\t}\n\n\tpublic stopSequenceNumberUpdate(): void {\n\t\tthis.opsCountSinceNoop = 0;\n\t\t// Ideally, we cancel timer here. But that will result in too often set/reset cycle if this client\n\t\t// keeps sending ops. In most cases it's actually better to let it expire (at most - 4 times per second)\n\t\t// for nothing, then have a ton of set/reset cycles.\n\t\t// Note that Timer.restart() is smart and will not change timer expiration if we keep extending timer\n\t\t// expiration - it will restart the timer instead when it fires with adjusted expiration.\n\t\t// this.timer.clear();\n\t}\n}\n"]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IDeltaManager, IDeltaQueue, IDeltaQueueEvents } from "@fluidframework/container-definitions";
|
|
6
|
-
import { EventForwarder } from "@fluidframework/common-utils";
|
|
7
|
-
import { IDocumentMessage, ISequencedDocumentMessage, ISignalMessage } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { DeltaManagerProxyBase } from "@fluidframework/container-utils";
|
|
9
|
-
/**
|
|
10
|
-
* Proxy to the real IDeltaQueue - used to restrict access
|
|
11
|
-
*/
|
|
12
|
-
export declare class DeltaQueueProxy<T> extends EventForwarder<IDeltaQueueEvents<T>> implements IDeltaQueue<T> {
|
|
13
|
-
private readonly queue;
|
|
14
|
-
get paused(): boolean;
|
|
15
|
-
get length(): number;
|
|
16
|
-
get idle(): boolean;
|
|
17
|
-
constructor(queue: IDeltaQueue<T>);
|
|
18
|
-
peek(): T | undefined;
|
|
19
|
-
toArray(): T[];
|
|
20
|
-
systemPause(): Promise<void>;
|
|
21
|
-
pause(): Promise<void>;
|
|
22
|
-
systemResume(): Promise<void>;
|
|
23
|
-
resume(): Promise<void>;
|
|
24
|
-
waitTillProcessingDone(): Promise<{
|
|
25
|
-
count: number;
|
|
26
|
-
duration: number;
|
|
27
|
-
}>;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Proxy to the real IDeltaManager - used to restrict access
|
|
31
|
-
*/
|
|
32
|
-
export declare class DeltaManagerProxy extends DeltaManagerProxyBase implements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {
|
|
33
|
-
get inbound(): IDeltaQueue<ISequencedDocumentMessage>;
|
|
34
|
-
private readonly _inbound;
|
|
35
|
-
get outbound(): IDeltaQueue<IDocumentMessage[]>;
|
|
36
|
-
private readonly _outbound;
|
|
37
|
-
get inboundSignal(): IDeltaQueue<ISignalMessage>;
|
|
38
|
-
private readonly _inboundSignal;
|
|
39
|
-
constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>);
|
|
40
|
-
dispose(): void;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=deltaManagerProxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deltaManagerProxy.d.ts","sourceRoot":"","sources":["../src/deltaManagerProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EACN,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE;;GAEG;AACH,qBAAa,eAAe,CAAC,CAAC,CAC7B,SAAQ,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAC3C,YAAW,WAAW,CAAC,CAAC,CAAC;IAcb,OAAO,CAAC,QAAQ,CAAC,KAAK;IAZlC,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,IAAI,IAAI,OAAO,CAEzB;gBAE4B,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAI3C,IAAI,IAAI,CAAC,GAAG,SAAS;IAIrB,OAAO,IAAI,CAAC,EAAE;IAKR,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,sBAAsB;;;;CAGnC;AAED;;GAEG;AACH,qBAAa,iBACZ,SAAQ,qBACR,YAAW,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC;IAErE,IAAW,OAAO,IAAI,WAAW,CAAC,yBAAyB,CAAC,CAE3D;IACD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyC;IAElE,IAAW,QAAQ,IAAI,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAErD;IACD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkC;IAE5D,IAAW,aAAa,IAAI,WAAW,CAAC,cAAc,CAAC,CAEtD;IACD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA8B;gBAEjD,YAAY,EAAE,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC;IAQ7E,OAAO,IAAI,IAAI;CAMtB"}
|
package/lib/deltaManagerProxy.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { EventForwarder } from "@fluidframework/common-utils";
|
|
6
|
-
import { DeltaManagerProxyBase } from "@fluidframework/container-utils";
|
|
7
|
-
/**
|
|
8
|
-
* Proxy to the real IDeltaQueue - used to restrict access
|
|
9
|
-
*/
|
|
10
|
-
export class DeltaQueueProxy extends EventForwarder {
|
|
11
|
-
constructor(queue) {
|
|
12
|
-
super(queue);
|
|
13
|
-
this.queue = queue;
|
|
14
|
-
}
|
|
15
|
-
get paused() {
|
|
16
|
-
return this.queue.paused;
|
|
17
|
-
}
|
|
18
|
-
get length() {
|
|
19
|
-
return this.queue.length;
|
|
20
|
-
}
|
|
21
|
-
get idle() {
|
|
22
|
-
return this.queue.idle;
|
|
23
|
-
}
|
|
24
|
-
peek() {
|
|
25
|
-
return this.queue.peek();
|
|
26
|
-
}
|
|
27
|
-
toArray() {
|
|
28
|
-
return this.queue.toArray();
|
|
29
|
-
}
|
|
30
|
-
// back-compat: usage removed in 0.33, remove in future versions
|
|
31
|
-
async systemPause() {
|
|
32
|
-
return this.pause();
|
|
33
|
-
}
|
|
34
|
-
async pause() {
|
|
35
|
-
return this.queue.pause();
|
|
36
|
-
}
|
|
37
|
-
// back-compat: usage removed in 0.33, remove in future versions
|
|
38
|
-
async systemResume() {
|
|
39
|
-
return this.resume();
|
|
40
|
-
}
|
|
41
|
-
async resume() {
|
|
42
|
-
this.queue.resume();
|
|
43
|
-
}
|
|
44
|
-
async waitTillProcessingDone() {
|
|
45
|
-
return this.queue.waitTillProcessingDone();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Proxy to the real IDeltaManager - used to restrict access
|
|
50
|
-
*/
|
|
51
|
-
export class DeltaManagerProxy extends DeltaManagerProxyBase {
|
|
52
|
-
constructor(deltaManager) {
|
|
53
|
-
super(deltaManager);
|
|
54
|
-
this._inbound = new DeltaQueueProxy(deltaManager.inbound);
|
|
55
|
-
this._outbound = new DeltaQueueProxy(deltaManager.outbound);
|
|
56
|
-
this._inboundSignal = new DeltaQueueProxy(deltaManager.inboundSignal);
|
|
57
|
-
}
|
|
58
|
-
get inbound() {
|
|
59
|
-
return this._inbound;
|
|
60
|
-
}
|
|
61
|
-
get outbound() {
|
|
62
|
-
return this._outbound;
|
|
63
|
-
}
|
|
64
|
-
get inboundSignal() {
|
|
65
|
-
return this._inboundSignal;
|
|
66
|
-
}
|
|
67
|
-
dispose() {
|
|
68
|
-
this._inbound.dispose();
|
|
69
|
-
this._outbound.dispose();
|
|
70
|
-
this._inboundSignal.dispose();
|
|
71
|
-
super.dispose();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=deltaManagerProxy.js.map
|