@fluidframework/container-runtime 2.0.0-internal.1.0.0.84253 → 2.0.0-internal.1.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/.mocharc.js +12 -0
- package/dist/blobManager.d.ts +7 -1
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +18 -1
- package/dist/blobManager.js.map +1 -1
- package/dist/containerRuntime.d.ts +2 -66
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +37 -295
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +3 -5
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +13 -23
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +1 -6
- package/dist/dataStores.js.map +1 -1
- package/dist/garbageCollection.d.ts +37 -6
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +61 -65
- package/dist/garbageCollection.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +15 -2
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts +28 -0
- package/dist/scheduleManager.d.ts.map +1 -0
- package/dist/scheduleManager.js +235 -0
- package/dist/scheduleManager.js.map +1 -0
- package/dist/summaryCollection.js +1 -1
- package/dist/summaryCollection.js.map +1 -1
- package/dist/summaryManager.d.ts.map +1 -1
- package/dist/summaryManager.js +20 -5
- package/dist/summaryManager.js.map +1 -1
- package/lib/blobManager.d.ts +7 -1
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +19 -2
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +2 -66
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +38 -295
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +3 -5
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +13 -23
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +1 -6
- package/lib/dataStores.js.map +1 -1
- package/lib/garbageCollection.d.ts +37 -6
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +47 -52
- package/lib/garbageCollection.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +15 -2
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts +28 -0
- package/lib/scheduleManager.d.ts.map +1 -0
- package/lib/scheduleManager.js +231 -0
- package/lib/scheduleManager.js.map +1 -0
- package/lib/summaryCollection.js +1 -1
- package/lib/summaryCollection.js.map +1 -1
- package/lib/summaryManager.d.ts.map +1 -1
- package/lib/summaryManager.js +20 -5
- package/lib/summaryManager.js.map +1 -1
- package/package.json +19 -15
- package/src/blobManager.ts +23 -1
- package/src/containerRuntime.ts +42 -392
- package/src/dataStoreContext.ts +10 -25
- package/src/dataStores.ts +0 -6
- package/src/garbageCollection.ts +64 -69
- package/src/index.ts +1 -2
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +18 -2
- package/src/scheduleManager.ts +294 -0
- package/src/summaryCollection.ts +1 -1
- package/src/summaryManager.ts +20 -5
|
@@ -15,7 +15,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
return t;
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.GarbageCollector = exports.GCNodeType = exports.defaultSessionExpiryDurationMs = exports.oneDayMs = exports.trackGCStateKey = exports.disableSessionExpiryKey = exports.runSessionExpiryKey = exports.gcBlobPrefix = exports.gcTreeKey = void 0;
|
|
18
|
+
exports.GarbageCollector = exports.UnreferencedStateTracker = exports.UnreferencedState = exports.GCNodeType = exports.defaultSessionExpiryDurationMs = exports.defaultInactiveTimeoutMs = exports.oneDayMs = exports.trackGCStateKey = exports.disableSessionExpiryKey = exports.runSessionExpiryKey = exports.gcTestModeKey = exports.runSweepKey = exports.runGCKey = exports.gcBlobPrefix = exports.gcTreeKey = void 0;
|
|
19
19
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
20
20
|
const container_utils_1 = require("@fluidframework/container-utils");
|
|
21
21
|
const garbage_collector_1 = require("@fluidframework/garbage-collector");
|
|
@@ -33,11 +33,11 @@ exports.gcTreeKey = "gc";
|
|
|
33
33
|
// They prefix for GC blobs in the GC tree in summary.
|
|
34
34
|
exports.gcBlobPrefix = "__gc";
|
|
35
35
|
// Feature gate key to turn GC on / off.
|
|
36
|
-
|
|
36
|
+
exports.runGCKey = "Fluid.GarbageCollection.RunGC";
|
|
37
37
|
// Feature gate key to turn GC sweep on / off.
|
|
38
|
-
|
|
38
|
+
exports.runSweepKey = "Fluid.GarbageCollection.RunSweep";
|
|
39
39
|
// Feature gate key to turn GC test mode on / off.
|
|
40
|
-
|
|
40
|
+
exports.gcTestModeKey = "Fluid.GarbageCollection.GCTestMode";
|
|
41
41
|
// Feature gate key to write GC data at the root of the summary tree.
|
|
42
42
|
const writeAtRootKey = "Fluid.GarbageCollection.WriteDataAtRoot";
|
|
43
43
|
// Feature gate key to expire a session after a set period of time.
|
|
@@ -50,7 +50,7 @@ exports.trackGCStateKey = "Fluid.GarbageCollection.TrackGCState";
|
|
|
50
50
|
const disableSweepLogKey = "Fluid.GarbageCollection.DisableSweepLog";
|
|
51
51
|
// One day in milliseconds.
|
|
52
52
|
exports.oneDayMs = 1 * 24 * 60 * 60 * 1000;
|
|
53
|
-
|
|
53
|
+
exports.defaultInactiveTimeoutMs = 7 * exports.oneDayMs; // 7 days
|
|
54
54
|
exports.defaultSessionExpiryDurationMs = 30 * exports.oneDayMs; // 30 days
|
|
55
55
|
/** The types of GC nodes in the GC reference graph. */
|
|
56
56
|
exports.GCNodeType = {
|
|
@@ -64,7 +64,7 @@ exports.GCNodeType = {
|
|
|
64
64
|
Other: "Other",
|
|
65
65
|
};
|
|
66
66
|
/** The state of node that is unreferenced. */
|
|
67
|
-
|
|
67
|
+
exports.UnreferencedState = {
|
|
68
68
|
/** The node is active, i.e., it can become referenced again. */
|
|
69
69
|
Active: "Active",
|
|
70
70
|
/** The node is inactive, i.e., it should not become referenced. */
|
|
@@ -87,9 +87,23 @@ class UnreferencedStateTracker {
|
|
|
87
87
|
this.unreferencedTimestampMs = unreferencedTimestampMs;
|
|
88
88
|
this.inactiveTimeoutMs = inactiveTimeoutMs;
|
|
89
89
|
this.sweepTimeoutMs = sweepTimeoutMs;
|
|
90
|
-
this._state = UnreferencedState.Active;
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
this._state = exports.UnreferencedState.Active;
|
|
91
|
+
if (this.sweepTimeoutMs !== undefined) {
|
|
92
|
+
(0, common_utils_1.assert)(this.inactiveTimeoutMs <= this.sweepTimeoutMs, 0x3b0 /* inactive timeout must not be greater than the sweep timeout */);
|
|
93
|
+
}
|
|
94
|
+
this.sweepTimer = new TimerWithNoDefaultTimeout(() => {
|
|
95
|
+
this._state = exports.UnreferencedState.SweepReady;
|
|
96
|
+
(0, common_utils_1.assert)(!this.inactiveTimer.hasTimer, 0x3b1 /* inactiveTimer still running after sweepTimer fired! */);
|
|
97
|
+
});
|
|
98
|
+
this.inactiveTimer = new TimerWithNoDefaultTimeout(() => {
|
|
99
|
+
this._state = exports.UnreferencedState.Inactive;
|
|
100
|
+
// After the node becomes inactive, start the sweep timer after which the node will be ready for sweep.
|
|
101
|
+
if (this.sweepTimeoutMs !== undefined) {
|
|
102
|
+
this.sweepTimer.restart(this.sweepTimeoutMs - this.inactiveTimeoutMs);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
// If there is no current reference timestamp, can't track the node's unreferenced state at this time.
|
|
106
|
+
// This will happen later when updateTracking is called with a reference timestamp.
|
|
93
107
|
if (currentReferenceTimestampMs !== undefined) {
|
|
94
108
|
this.updateTracking(currentReferenceTimestampMs);
|
|
95
109
|
}
|
|
@@ -102,47 +116,34 @@ class UnreferencedStateTracker {
|
|
|
102
116
|
const unreferencedDurationMs = currentReferenceTimestampMs - this.unreferencedTimestampMs;
|
|
103
117
|
// If the node has been unreferenced for sweep timeout amount of time, update the state to SweepReady.
|
|
104
118
|
if (this.sweepTimeoutMs !== undefined && unreferencedDurationMs >= this.sweepTimeoutMs) {
|
|
105
|
-
this._state = UnreferencedState.SweepReady;
|
|
119
|
+
this._state = exports.UnreferencedState.SweepReady;
|
|
106
120
|
this.clearTimers();
|
|
107
121
|
return;
|
|
108
122
|
}
|
|
109
123
|
// If the node has been unreferenced for inactive timeoutMs amount of time, update the state to inactive.
|
|
110
124
|
// Also, start a timer for the sweep timeout.
|
|
111
125
|
if (unreferencedDurationMs >= this.inactiveTimeoutMs) {
|
|
112
|
-
this._state = UnreferencedState.Inactive;
|
|
113
|
-
this.
|
|
126
|
+
this._state = exports.UnreferencedState.Inactive;
|
|
127
|
+
this.inactiveTimer.clear();
|
|
114
128
|
if (this.sweepTimeoutMs !== undefined) {
|
|
115
|
-
|
|
129
|
+
this.sweepTimer.restart(this.sweepTimeoutMs - unreferencedDurationMs);
|
|
116
130
|
}
|
|
117
131
|
return;
|
|
118
132
|
}
|
|
119
|
-
// The node is still active.
|
|
120
|
-
|
|
121
|
-
if (this.inactiveTimer === undefined) {
|
|
122
|
-
const inactiveTimeoutHandler = () => {
|
|
123
|
-
this._state = UnreferencedState.Inactive;
|
|
124
|
-
// After the node becomes inactive, start the sweep timer after which the node will be ready for sweep.
|
|
125
|
-
if (this.sweepTimeoutMs !== undefined) {
|
|
126
|
-
setLongTimeout(this.sweepTimeoutMs - this.inactiveTimeoutMs, () => { this._state = UnreferencedState.SweepReady; }, (timer) => { this.sweepTimer = timer; });
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
this.inactiveTimer = new common_utils_1.Timer(remainingDurationMs, () => inactiveTimeoutHandler());
|
|
130
|
-
}
|
|
131
|
-
this.inactiveTimer.restart(remainingDurationMs);
|
|
133
|
+
// The node is still active. Ensure the inactive timer is running with the proper remaining duration.
|
|
134
|
+
this.inactiveTimer.restart(this.inactiveTimeoutMs - unreferencedDurationMs);
|
|
132
135
|
}
|
|
133
136
|
clearTimers() {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (this.sweepTimer !== undefined) {
|
|
137
|
-
clearTimeout(this.sweepTimer);
|
|
138
|
-
}
|
|
137
|
+
this.inactiveTimer.clear();
|
|
138
|
+
this.sweepTimer.clear();
|
|
139
139
|
}
|
|
140
140
|
/** Stop tracking this node. Reset the unreferenced timers and state, if any. */
|
|
141
141
|
stopTracking() {
|
|
142
142
|
this.clearTimers();
|
|
143
|
-
this._state = UnreferencedState.Active;
|
|
143
|
+
this._state = exports.UnreferencedState.Active;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
+
exports.UnreferencedStateTracker = UnreferencedStateTracker;
|
|
146
147
|
/**
|
|
147
148
|
* The garbage collector for the container runtime. It consolidates the garbage collection functionality and maintains
|
|
148
149
|
* its state across summaries.
|
|
@@ -228,7 +229,7 @@ class GarbageCollector {
|
|
|
228
229
|
this.gcEnabled = this.gcOptions.gcAllowed !== false;
|
|
229
230
|
// The sweep phase has to be explicitly enabled by setting the sweepAllowed flag in GC options to true.
|
|
230
231
|
this.sweepEnabled = this.gcOptions.sweepAllowed === true;
|
|
231
|
-
// Set the Session Expiry only if the flag is enabled
|
|
232
|
+
// Set the Session Expiry only if the flag is enabled and GC is enabled.
|
|
232
233
|
if (this.mc.config.getBoolean(exports.runSessionExpiryKey) && this.gcEnabled) {
|
|
233
234
|
this.sessionExpiryTimeoutMs = (_b = this.gcOptions.sessionExpiryTimeoutMs) !== null && _b !== void 0 ? _b : exports.defaultSessionExpiryDurationMs;
|
|
234
235
|
}
|
|
@@ -238,7 +239,8 @@ class GarbageCollector {
|
|
|
238
239
|
// If Test Override config is set, override Session Expiry timeout.
|
|
239
240
|
const overrideSessionExpiryTimeoutMs = this.mc.config.getNumber("Fluid.GarbageCollection.TestOverride.SessionExpiryMs");
|
|
240
241
|
const timeoutMs = overrideSessionExpiryTimeoutMs !== null && overrideSessionExpiryTimeoutMs !== void 0 ? overrideSessionExpiryTimeoutMs : this.sessionExpiryTimeoutMs;
|
|
241
|
-
|
|
242
|
+
this.sessionExpiryTimer = new common_utils_1.Timer(timeoutMs, () => { this.runtime.closeFn(new container_utils_1.ClientSessionExpiredError(`Client session expired.`, timeoutMs)); });
|
|
243
|
+
this.sessionExpiryTimer.start();
|
|
242
244
|
// TEMPORARY: Hardcode a default of 2 days which is the value used in the ODSP driver.
|
|
243
245
|
// This unblocks the Sweep Log (see logSweepEvents function).
|
|
244
246
|
// This will be removed before sweep is fully implemented.
|
|
@@ -262,7 +264,7 @@ class GarbageCollector {
|
|
|
262
264
|
* 2. GC should not be disabled via disableGC GC option.
|
|
263
265
|
* These conditions can be overridden via runGCKey feature flag.
|
|
264
266
|
*/
|
|
265
|
-
this.shouldRunGC = (_d = this.mc.config.getBoolean(runGCKey)) !== null && _d !== void 0 ? _d : (
|
|
267
|
+
this.shouldRunGC = (_d = this.mc.config.getBoolean(exports.runGCKey)) !== null && _d !== void 0 ? _d : (
|
|
266
268
|
// GC must be enabled for the document.
|
|
267
269
|
this.gcEnabled
|
|
268
270
|
// GC must not be disabled via GC options.
|
|
@@ -280,13 +282,13 @@ class GarbageCollector {
|
|
|
280
282
|
// && (this.mc.config.getBoolean(runSweepKey) ?? this.sweepEnabled);
|
|
281
283
|
this.trackGCState = this.mc.config.getBoolean(exports.trackGCStateKey) === true;
|
|
282
284
|
// Override inactive timeout if test config or gc options to override it is set.
|
|
283
|
-
this.inactiveTimeoutMs = (_f = (_e = this.mc.config.getNumber("Fluid.GarbageCollection.TestOverride.InactiveTimeoutMs")) !== null && _e !== void 0 ? _e : this.gcOptions.inactiveTimeoutMs) !== null && _f !== void 0 ? _f : defaultInactiveTimeoutMs;
|
|
285
|
+
this.inactiveTimeoutMs = (_f = (_e = this.mc.config.getNumber("Fluid.GarbageCollection.TestOverride.InactiveTimeoutMs")) !== null && _e !== void 0 ? _e : this.gcOptions.inactiveTimeoutMs) !== null && _f !== void 0 ? _f : exports.defaultInactiveTimeoutMs;
|
|
284
286
|
// Inactive timeout must be greater than sweep timeout since a node goes from active -> inactive -> sweep ready.
|
|
285
287
|
if (this.sweepTimeoutMs !== undefined && this.inactiveTimeoutMs > this.sweepTimeoutMs) {
|
|
286
|
-
throw new container_utils_1.UsageError("inactive timeout should not be
|
|
288
|
+
throw new container_utils_1.UsageError("inactive timeout should not be greater than the sweep timeout");
|
|
287
289
|
}
|
|
288
290
|
// Whether we are running in test mode. In this mode, unreferenced nodes are immediately deleted.
|
|
289
|
-
this.testMode = (_g = this.mc.config.getBoolean(gcTestModeKey)) !== null && _g !== void 0 ? _g : this.gcOptions.runGCInTestMode === true;
|
|
291
|
+
this.testMode = (_g = this.mc.config.getBoolean(exports.gcTestModeKey)) !== null && _g !== void 0 ? _g : this.gcOptions.runGCInTestMode === true;
|
|
290
292
|
// GC state is written into root of the summary tree by default. Can be overridden via feature flag for now.
|
|
291
293
|
this._writeDataAtRoot = (_h = this.mc.config.getBoolean(writeAtRootKey)) !== null && _h !== void 0 ? _h : true;
|
|
292
294
|
if (this._writeDataAtRoot) {
|
|
@@ -385,7 +387,7 @@ class GarbageCollector {
|
|
|
385
387
|
// each node in the summary.
|
|
386
388
|
const usedRoutes = (0, garbage_collector_1.runGarbageCollection)(gcNodes, ["/"]).referencedNodeIds;
|
|
387
389
|
const baseGCDetailsMap = (0, garbage_collector_1.unpackChildNodesGCDetails)({ gcData: { gcNodes }, usedRoutes });
|
|
388
|
-
// Currently, the nodes may write the GC data. So, we need to update
|
|
390
|
+
// Currently, the nodes may write the GC data. So, we need to update its base GC details with the
|
|
389
391
|
// unreferenced timestamp. Once we start writing the GC data here, we won't need to do this anymore.
|
|
390
392
|
for (const [nodeId, nodeData] of Object.entries(baseState.gcNodes)) {
|
|
391
393
|
if (nodeData.unreferencedTimestampMs !== undefined) {
|
|
@@ -596,7 +598,7 @@ class GarbageCollector {
|
|
|
596
598
|
return;
|
|
597
599
|
}
|
|
598
600
|
const nodeStateTracker = this.unreferencedNodesState.get(nodePath);
|
|
599
|
-
if (nodeStateTracker && nodeStateTracker.state !== UnreferencedState.Active) {
|
|
601
|
+
if (nodeStateTracker && nodeStateTracker.state !== exports.UnreferencedState.Active) {
|
|
600
602
|
this.inactiveNodeUsed(reason, nodePath, nodeStateTracker, undefined /* fromNodeId */, packagePath, timestampMs, requestHeaders);
|
|
601
603
|
}
|
|
602
604
|
}
|
|
@@ -616,15 +618,14 @@ class GarbageCollector {
|
|
|
616
618
|
outboundRoutes.push(toNodePath);
|
|
617
619
|
this.newReferencesSinceLastRun.set(fromNodePath, outboundRoutes);
|
|
618
620
|
const nodeStateTracker = this.unreferencedNodesState.get(toNodePath);
|
|
619
|
-
if (nodeStateTracker && nodeStateTracker.state !== UnreferencedState.Active) {
|
|
621
|
+
if (nodeStateTracker && nodeStateTracker.state !== exports.UnreferencedState.Active) {
|
|
620
622
|
this.inactiveNodeUsed("Revived", toNodePath, nodeStateTracker, fromNodePath);
|
|
621
623
|
}
|
|
622
624
|
}
|
|
623
625
|
dispose() {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
}
|
|
626
|
+
var _a;
|
|
627
|
+
(_a = this.sessionExpiryTimer) === null || _a === void 0 ? void 0 : _a.clear();
|
|
628
|
+
this.sessionExpiryTimer = undefined;
|
|
628
629
|
}
|
|
629
630
|
/**
|
|
630
631
|
* Updates the state of the system as per the current GC run. It does the following:
|
|
@@ -848,7 +849,7 @@ class GarbageCollector {
|
|
|
848
849
|
return;
|
|
849
850
|
}
|
|
850
851
|
this.unreferencedNodesState.forEach((nodeStateTracker, nodeId) => {
|
|
851
|
-
if (nodeStateTracker.state !== UnreferencedState.SweepReady) {
|
|
852
|
+
if (nodeStateTracker.state !== exports.UnreferencedState.SweepReady) {
|
|
852
853
|
return;
|
|
853
854
|
}
|
|
854
855
|
const nodeType = this.runtime.getNodeType(nodeId);
|
|
@@ -879,7 +880,7 @@ class GarbageCollector {
|
|
|
879
880
|
// If there is no reference timestamp to work with, no ops have been processed after creation. If so, skip
|
|
880
881
|
// logging as nothing interesting would have happened worth logging.
|
|
881
882
|
// If the node is active, skip logging.
|
|
882
|
-
if (currentReferenceTimestampMs === undefined || nodeStateTracker.state === UnreferencedState.Active) {
|
|
883
|
+
if (currentReferenceTimestampMs === undefined || nodeStateTracker.state === exports.UnreferencedState.Active) {
|
|
883
884
|
return;
|
|
884
885
|
}
|
|
885
886
|
// For non-summarizer clients, only log "Loaded" type events since these objects may not be loaded in the
|
|
@@ -904,7 +905,7 @@ class GarbageCollector {
|
|
|
904
905
|
type: nodeType,
|
|
905
906
|
unrefTime: nodeStateTracker.unreferencedTimestampMs,
|
|
906
907
|
age: currentReferenceTimestampMs - nodeStateTracker.unreferencedTimestampMs,
|
|
907
|
-
timeout: nodeStateTracker.state === UnreferencedState.Inactive
|
|
908
|
+
timeout: nodeStateTracker.state === exports.UnreferencedState.Inactive
|
|
908
909
|
? this.inactiveTimeoutMs
|
|
909
910
|
: this.sweepTimeoutMs,
|
|
910
911
|
completedGCRuns: this.completedRuns,
|
|
@@ -933,7 +934,7 @@ class GarbageCollector {
|
|
|
933
934
|
* revived and a Revived event will be logged for it.
|
|
934
935
|
*/
|
|
935
936
|
const nodeStateTracker = this.unreferencedNodesState.get(eventProps.id);
|
|
936
|
-
const active = nodeStateTracker === undefined || nodeStateTracker.state === UnreferencedState.Active;
|
|
937
|
+
const active = nodeStateTracker === undefined || nodeStateTracker.state === exports.UnreferencedState.Active;
|
|
937
938
|
if ((usageType === "Revived") === active) {
|
|
938
939
|
const pkg = await this.getNodePackagePath(eventProps.id);
|
|
939
940
|
const fromPkg = eventProps.fromId ? await this.getNodePackagePath(eventProps.fromId) : undefined;
|
|
@@ -976,23 +977,18 @@ function generateSortedGCState(gcState) {
|
|
|
976
977
|
}
|
|
977
978
|
return sortedGCState;
|
|
978
979
|
}
|
|
979
|
-
/**
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
let timer;
|
|
989
|
-
if (timeoutMs > maxTimeout) {
|
|
990
|
-
const newTimeoutMs = timeoutMs - maxTimeout;
|
|
991
|
-
timer = setTimeout(() => setLongTimeout(newTimeoutMs, timeoutFn, setTimerFn), maxTimeout);
|
|
980
|
+
/** A wrapper around common-utils Timer that requires the timeout when calling start/restart */
|
|
981
|
+
class TimerWithNoDefaultTimeout extends common_utils_1.Timer {
|
|
982
|
+
constructor(callback) {
|
|
983
|
+
// The default timeout/handlers will never be used since start/restart pass overrides below
|
|
984
|
+
super(0, () => { throw new Error("DefaultHandler should not be used"); });
|
|
985
|
+
this.callback = callback;
|
|
986
|
+
}
|
|
987
|
+
start(timeoutMs) {
|
|
988
|
+
super.start(timeoutMs, this.callback);
|
|
992
989
|
}
|
|
993
|
-
|
|
994
|
-
|
|
990
|
+
restart(timeoutMs) {
|
|
991
|
+
super.restart(timeoutMs, this.callback);
|
|
995
992
|
}
|
|
996
|
-
setTimerFn(timer);
|
|
997
993
|
}
|
|
998
994
|
//# sourceMappingURL=garbageCollection.js.map
|