@camstack/system 1.2.213 → 1.2.214
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/addon-utils.d.ts +1 -0
- package/dist/addon-utils.js +15 -11
- package/dist/addon-utils.mjs +2 -2
- package/dist/{file-data-plane-BhKdxJgf.mjs → event-loop-stall-monitor-B3CFd9tM.mjs} +138 -1
- package/dist/{file-data-plane-DO8KbxCe.js → event-loop-stall-monitor-DM9OAzy8.js} +161 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -16
- package/dist/index.mjs +2 -2
- package/dist/kernel/event-loop-stall-monitor.d.ts +41 -0
- package/package.json +1 -1
package/dist/addon-utils.d.ts
CHANGED
|
@@ -19,3 +19,4 @@ export { ModelDownloadService } from './download/model-download-service.js';
|
|
|
19
19
|
export { createFileDataPlaneHandler } from './http/file-data-plane.js';
|
|
20
20
|
export { parseRangeHeader, contentTypeFor, type ByteRange, } from './http/authenticated-file-server.js';
|
|
21
21
|
export { CustomActionRegistry } from './kernel/custom-action-registry.js';
|
|
22
|
+
export { attributeStall, STALL_REPORT_MS, STALL_TICK_MS, startEventLoopStallMonitor, type StallVerdict, } from './kernel/event-loop-stall-monitor.js';
|
package/dist/addon-utils.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const
|
|
3
|
+
const require_event_loop_stall_monitor = require("./event-loop-stall-monitor-DM9OAzy8.js");
|
|
4
4
|
const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
|
|
5
5
|
exports.CustomActionRegistry = require_custom_action_registry.CustomActionRegistry;
|
|
6
|
-
exports.ModelDownloadService =
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
6
|
+
exports.ModelDownloadService = require_event_loop_stall_monitor.ModelDownloadService;
|
|
7
|
+
exports.STALL_REPORT_MS = require_event_loop_stall_monitor.STALL_REPORT_MS;
|
|
8
|
+
exports.STALL_TICK_MS = require_event_loop_stall_monitor.STALL_TICK_MS;
|
|
9
|
+
exports.attributeStall = require_event_loop_stall_monitor.attributeStall;
|
|
10
|
+
exports.collectModelFiles = require_event_loop_stall_monitor.collectModelFiles;
|
|
11
|
+
exports.contentTypeFor = require_event_loop_stall_monitor.contentTypeFor;
|
|
12
|
+
exports.createFileDataPlaneHandler = require_event_loop_stall_monitor.createFileDataPlaneHandler;
|
|
13
|
+
exports.deleteModelFromDisk = require_event_loop_stall_monitor.deleteModelFromDisk;
|
|
14
|
+
exports.downloadFile = require_event_loop_stall_monitor.downloadFile;
|
|
15
|
+
exports.ensureModel = require_event_loop_stall_monitor.ensureModel;
|
|
16
|
+
exports.getModelFilePath = require_event_loop_stall_monitor.getModelFilePath;
|
|
17
|
+
exports.isModelDownloaded = require_event_loop_stall_monitor.isModelDownloaded;
|
|
18
|
+
exports.parseRangeHeader = require_event_loop_stall_monitor.parseRangeHeader;
|
|
19
|
+
exports.startEventLoopStallMonitor = require_event_loop_stall_monitor.startEventLoopStallMonitor;
|
package/dist/addon-utils.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { a as createFileDataPlaneHandler, c as parseRangeHeader, d as ModelDownloadService, f as collectModelFiles, g as ensureModel, i as startEventLoopStallMonitor, m as downloadFile, n as STALL_TICK_MS, o as contentTypeFor, p as deleteModelFromDisk, r as attributeStall, t as STALL_REPORT_MS, v as getModelFilePath, y as isModelDownloaded } from "./event-loop-stall-monitor-B3CFd9tM.mjs";
|
|
2
2
|
import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
|
|
3
|
-
export { CustomActionRegistry, ModelDownloadService, collectModelFiles, contentTypeFor, createFileDataPlaneHandler, deleteModelFromDisk, downloadFile, ensureModel, getModelFilePath, isModelDownloaded, parseRangeHeader };
|
|
3
|
+
export { CustomActionRegistry, ModelDownloadService, STALL_REPORT_MS, STALL_TICK_MS, attributeStall, collectModelFiles, contentTypeFor, createFileDataPlaneHandler, deleteModelFromDisk, downloadFile, ensureModel, getModelFilePath, isModelDownloaded, parseRangeHeader, startEventLoopStallMonitor };
|
|
@@ -6,6 +6,7 @@ import * as fs from "node:fs";
|
|
|
6
6
|
import { createReadStream, promises } from "node:fs";
|
|
7
7
|
import { createServer } from "node:http";
|
|
8
8
|
import { brotliCompress, constants as constants$1, gzip } from "node:zlib";
|
|
9
|
+
import { PerformanceObserver } from "node:perf_hooks";
|
|
9
10
|
//#region src/download/model-downloader.ts
|
|
10
11
|
function isNonEmptyFile(filePath) {
|
|
11
12
|
return fs.existsSync(filePath) && fs.statSync(filePath).size > 0;
|
|
@@ -974,4 +975,140 @@ function createFileDataPlaneHandler(opts) {
|
|
|
974
975
|
};
|
|
975
976
|
}
|
|
976
977
|
//#endregion
|
|
977
|
-
|
|
978
|
+
//#region src/kernel/event-loop-stall-monitor.ts
|
|
979
|
+
/**
|
|
980
|
+
* event-loop-stall-monitor — names the thing that freezes the detection process.
|
|
981
|
+
*
|
|
982
|
+
* ## What this exists to settle
|
|
983
|
+
*
|
|
984
|
+
* On 2026-08-01/02 inference across the whole fleet stalled in bursts: 759
|
|
985
|
+
* calls in 90 minutes crossed the runner's 20s deadline, p50 41s and max 80s,
|
|
986
|
+
* and EVERY one of them eventually resolved. Six explanations were killed with
|
|
987
|
+
* telemetry alone:
|
|
988
|
+
*
|
|
989
|
+
* - not a slow GPU or a wedged pool — the work completes, just enormously late;
|
|
990
|
+
* - not CPU starvation — hosts sat at 8-48% during the freezes;
|
|
991
|
+
* - not swap — `pswpin/pswpout` are flat zero on every host;
|
|
992
|
+
* - not a logging artifact — Loki's timestamp trails the in-process one by
|
|
993
|
+
* 0.1-1.0s at p95, so the gaps are real, not buffered delivery;
|
|
994
|
+
* - not the v1.2.30 release — the stalls predate it by a day;
|
|
995
|
+
* - not only the idle-pool recompile — that is real and hub-side, but the
|
|
996
|
+
* agent stalls with no eviction and no compile at all.
|
|
997
|
+
*
|
|
998
|
+
* What IS established: the 10s stats timer — which touches no inference code —
|
|
999
|
+
* stops firing for 22-88s and resumes at the same instant the abandoned calls
|
|
1000
|
+
* settle. The event loop itself freezes. From outside the process, GC and a
|
|
1001
|
+
* synchronous block are indistinguishable, and guessing between them is how
|
|
1002
|
+
* this investigation would go wrong. So measure it.
|
|
1003
|
+
*
|
|
1004
|
+
* ## How
|
|
1005
|
+
*
|
|
1006
|
+
* A 1s interval whose LATENESS is the freeze: a tick that arrives 40s late means
|
|
1007
|
+
* the loop was blocked ~39s, whatever blocked it. In the same window the GC
|
|
1008
|
+
* observer accumulates pause time. The two numbers together answer the question
|
|
1009
|
+
* outright:
|
|
1010
|
+
*
|
|
1011
|
+
* - `gcMs` ≈ `stallMs` → garbage collection. Look at heap growth.
|
|
1012
|
+
* - `gcMs` ≈ 0 → something SYNCHRONOUS blocked the loop, and GC is innocent.
|
|
1013
|
+
*
|
|
1014
|
+
* Heap and RSS ride along because if it is GC, the next question is always
|
|
1015
|
+
* "growing since when?".
|
|
1016
|
+
*
|
|
1017
|
+
* Deliberately not a histogram (`monitorEventLoopDelay`): that reports a
|
|
1018
|
+
* distribution, and the question here is about ONE outlier and what coincided
|
|
1019
|
+
* with it.
|
|
1020
|
+
*/
|
|
1021
|
+
/** Tick period. Small enough to bound attribution error, large enough to cost
|
|
1022
|
+
* nothing on a process already doing frame work. */
|
|
1023
|
+
var STALL_TICK_MS = 1e3;
|
|
1024
|
+
/**
|
|
1025
|
+
* Report a freeze only past this. The runner's own inference deadline is 20s
|
|
1026
|
+
* and the observed freezes run 22-88s, so this is far below the signal while
|
|
1027
|
+
* staying clear of ordinary scheduling jitter (a busy frame path routinely
|
|
1028
|
+
* overruns a 1s timer by tens of ms).
|
|
1029
|
+
*/
|
|
1030
|
+
var STALL_REPORT_MS = 2e3;
|
|
1031
|
+
/**
|
|
1032
|
+
* Attribute a freeze. Pure, because this is the ONE judgement the whole module
|
|
1033
|
+
* exists to make and it must be testable without freezing a real event loop.
|
|
1034
|
+
*
|
|
1035
|
+
* `gc` when garbage collection accounts for most of the stall; a
|
|
1036
|
+
* `synchronous-block` when it accounts for almost none — that verdict points
|
|
1037
|
+
* away from the heap entirely and at whatever ran without yielding.
|
|
1038
|
+
*/
|
|
1039
|
+
function attributeStall(stallMs, gcMs, gcCount, longestGcMs) {
|
|
1040
|
+
const share = stallMs > 0 ? gcMs / stallMs : 0;
|
|
1041
|
+
return {
|
|
1042
|
+
stallMs,
|
|
1043
|
+
gcMs,
|
|
1044
|
+
gcCount,
|
|
1045
|
+
longestGcMs,
|
|
1046
|
+
cause: share >= .7 ? "gc" : share <= .2 ? "synchronous-block" : "mixed"
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Start watching. Returns a stop function; safe to call twice.
|
|
1051
|
+
*
|
|
1052
|
+
* Never throws into the caller: a diagnostic that can take the detection
|
|
1053
|
+
* process down is worse than no diagnostic. `PerformanceObserver` for `gc` is
|
|
1054
|
+
* unavailable in some embedded runtimes, and that must degrade to
|
|
1055
|
+
* stall-detection-without-attribution rather than a boot failure.
|
|
1056
|
+
*/
|
|
1057
|
+
function startEventLoopStallMonitor(logger, reportThresholdMs = STALL_REPORT_MS) {
|
|
1058
|
+
let gc = {
|
|
1059
|
+
totalMs: 0,
|
|
1060
|
+
count: 0,
|
|
1061
|
+
longestMs: 0
|
|
1062
|
+
};
|
|
1063
|
+
let observer = null;
|
|
1064
|
+
try {
|
|
1065
|
+
observer = new PerformanceObserver((list) => {
|
|
1066
|
+
for (const entry of list.getEntries()) {
|
|
1067
|
+
gc.totalMs += entry.duration;
|
|
1068
|
+
gc.count += 1;
|
|
1069
|
+
if (entry.duration > gc.longestMs) gc.longestMs = entry.duration;
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
observer.observe({ entryTypes: ["gc"] });
|
|
1073
|
+
} catch {
|
|
1074
|
+
observer = null;
|
|
1075
|
+
}
|
|
1076
|
+
let expected = Date.now() + STALL_TICK_MS;
|
|
1077
|
+
const timer = setInterval(() => {
|
|
1078
|
+
const now = Date.now();
|
|
1079
|
+
const lateBy = now - expected;
|
|
1080
|
+
const window = gc;
|
|
1081
|
+
gc = {
|
|
1082
|
+
totalMs: 0,
|
|
1083
|
+
count: 0,
|
|
1084
|
+
longestMs: 0
|
|
1085
|
+
};
|
|
1086
|
+
expected = now + STALL_TICK_MS;
|
|
1087
|
+
if (lateBy < reportThresholdMs) return;
|
|
1088
|
+
const verdict = attributeStall(lateBy, Math.round(window.totalMs), window.count, Math.round(window.longestMs));
|
|
1089
|
+
const mem = process.memoryUsage();
|
|
1090
|
+
logger.warn("event loop stalled", { meta: {
|
|
1091
|
+
stallMs: verdict.stallMs,
|
|
1092
|
+
cause: verdict.cause,
|
|
1093
|
+
gcMs: verdict.gcMs,
|
|
1094
|
+
gcCount: verdict.gcCount,
|
|
1095
|
+
longestGcMs: verdict.longestGcMs,
|
|
1096
|
+
gcObserved: observer !== null,
|
|
1097
|
+
heapUsedMb: Math.round(mem.heapUsed / 1e6),
|
|
1098
|
+
heapTotalMb: Math.round(mem.heapTotal / 1e6),
|
|
1099
|
+
rssMb: Math.round(mem.rss / 1e6),
|
|
1100
|
+
externalMb: Math.round(mem.external / 1e6),
|
|
1101
|
+
arrayBuffersMb: Math.round(mem.arrayBuffers / 1e6)
|
|
1102
|
+
} });
|
|
1103
|
+
}, STALL_TICK_MS);
|
|
1104
|
+
timer.unref?.();
|
|
1105
|
+
let stopped = false;
|
|
1106
|
+
return () => {
|
|
1107
|
+
if (stopped) return;
|
|
1108
|
+
stopped = true;
|
|
1109
|
+
clearInterval(timer);
|
|
1110
|
+
observer?.disconnect();
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
//#endregion
|
|
1114
|
+
export { fetchJson as _, createFileDataPlaneHandler as a, parseRangeHeader as c, ModelDownloadService as d, collectModelFiles as f, ensureModel as g, downloadModel as h, startEventLoopStallMonitor as i, parseTokenizedUrl as l, downloadFile as m, STALL_TICK_MS as n, contentTypeFor as o, deleteModelFromDisk as p, attributeStall as r, createAuthenticatedFileServer as s, STALL_REPORT_MS as t, resolveFilePath as u, getModelFilePath as v, isModelDownloaded as y };
|
|
@@ -7,6 +7,7 @@ let node_fs = require("node:fs");
|
|
|
7
7
|
node_fs = require_chunk.__toESM(node_fs);
|
|
8
8
|
let node_http = require("node:http");
|
|
9
9
|
let node_zlib = require("node:zlib");
|
|
10
|
+
let node_perf_hooks = require("node:perf_hooks");
|
|
10
11
|
//#region src/download/model-downloader.ts
|
|
11
12
|
function isNonEmptyFile(filePath) {
|
|
12
13
|
return node_fs.existsSync(filePath) && node_fs.statSync(filePath).size > 0;
|
|
@@ -975,12 +976,166 @@ function createFileDataPlaneHandler(opts) {
|
|
|
975
976
|
};
|
|
976
977
|
}
|
|
977
978
|
//#endregion
|
|
979
|
+
//#region src/kernel/event-loop-stall-monitor.ts
|
|
980
|
+
/**
|
|
981
|
+
* event-loop-stall-monitor — names the thing that freezes the detection process.
|
|
982
|
+
*
|
|
983
|
+
* ## What this exists to settle
|
|
984
|
+
*
|
|
985
|
+
* On 2026-08-01/02 inference across the whole fleet stalled in bursts: 759
|
|
986
|
+
* calls in 90 minutes crossed the runner's 20s deadline, p50 41s and max 80s,
|
|
987
|
+
* and EVERY one of them eventually resolved. Six explanations were killed with
|
|
988
|
+
* telemetry alone:
|
|
989
|
+
*
|
|
990
|
+
* - not a slow GPU or a wedged pool — the work completes, just enormously late;
|
|
991
|
+
* - not CPU starvation — hosts sat at 8-48% during the freezes;
|
|
992
|
+
* - not swap — `pswpin/pswpout` are flat zero on every host;
|
|
993
|
+
* - not a logging artifact — Loki's timestamp trails the in-process one by
|
|
994
|
+
* 0.1-1.0s at p95, so the gaps are real, not buffered delivery;
|
|
995
|
+
* - not the v1.2.30 release — the stalls predate it by a day;
|
|
996
|
+
* - not only the idle-pool recompile — that is real and hub-side, but the
|
|
997
|
+
* agent stalls with no eviction and no compile at all.
|
|
998
|
+
*
|
|
999
|
+
* What IS established: the 10s stats timer — which touches no inference code —
|
|
1000
|
+
* stops firing for 22-88s and resumes at the same instant the abandoned calls
|
|
1001
|
+
* settle. The event loop itself freezes. From outside the process, GC and a
|
|
1002
|
+
* synchronous block are indistinguishable, and guessing between them is how
|
|
1003
|
+
* this investigation would go wrong. So measure it.
|
|
1004
|
+
*
|
|
1005
|
+
* ## How
|
|
1006
|
+
*
|
|
1007
|
+
* A 1s interval whose LATENESS is the freeze: a tick that arrives 40s late means
|
|
1008
|
+
* the loop was blocked ~39s, whatever blocked it. In the same window the GC
|
|
1009
|
+
* observer accumulates pause time. The two numbers together answer the question
|
|
1010
|
+
* outright:
|
|
1011
|
+
*
|
|
1012
|
+
* - `gcMs` ≈ `stallMs` → garbage collection. Look at heap growth.
|
|
1013
|
+
* - `gcMs` ≈ 0 → something SYNCHRONOUS blocked the loop, and GC is innocent.
|
|
1014
|
+
*
|
|
1015
|
+
* Heap and RSS ride along because if it is GC, the next question is always
|
|
1016
|
+
* "growing since when?".
|
|
1017
|
+
*
|
|
1018
|
+
* Deliberately not a histogram (`monitorEventLoopDelay`): that reports a
|
|
1019
|
+
* distribution, and the question here is about ONE outlier and what coincided
|
|
1020
|
+
* with it.
|
|
1021
|
+
*/
|
|
1022
|
+
/** Tick period. Small enough to bound attribution error, large enough to cost
|
|
1023
|
+
* nothing on a process already doing frame work. */
|
|
1024
|
+
var STALL_TICK_MS = 1e3;
|
|
1025
|
+
/**
|
|
1026
|
+
* Report a freeze only past this. The runner's own inference deadline is 20s
|
|
1027
|
+
* and the observed freezes run 22-88s, so this is far below the signal while
|
|
1028
|
+
* staying clear of ordinary scheduling jitter (a busy frame path routinely
|
|
1029
|
+
* overruns a 1s timer by tens of ms).
|
|
1030
|
+
*/
|
|
1031
|
+
var STALL_REPORT_MS = 2e3;
|
|
1032
|
+
/**
|
|
1033
|
+
* Attribute a freeze. Pure, because this is the ONE judgement the whole module
|
|
1034
|
+
* exists to make and it must be testable without freezing a real event loop.
|
|
1035
|
+
*
|
|
1036
|
+
* `gc` when garbage collection accounts for most of the stall; a
|
|
1037
|
+
* `synchronous-block` when it accounts for almost none — that verdict points
|
|
1038
|
+
* away from the heap entirely and at whatever ran without yielding.
|
|
1039
|
+
*/
|
|
1040
|
+
function attributeStall(stallMs, gcMs, gcCount, longestGcMs) {
|
|
1041
|
+
const share = stallMs > 0 ? gcMs / stallMs : 0;
|
|
1042
|
+
return {
|
|
1043
|
+
stallMs,
|
|
1044
|
+
gcMs,
|
|
1045
|
+
gcCount,
|
|
1046
|
+
longestGcMs,
|
|
1047
|
+
cause: share >= .7 ? "gc" : share <= .2 ? "synchronous-block" : "mixed"
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* Start watching. Returns a stop function; safe to call twice.
|
|
1052
|
+
*
|
|
1053
|
+
* Never throws into the caller: a diagnostic that can take the detection
|
|
1054
|
+
* process down is worse than no diagnostic. `PerformanceObserver` for `gc` is
|
|
1055
|
+
* unavailable in some embedded runtimes, and that must degrade to
|
|
1056
|
+
* stall-detection-without-attribution rather than a boot failure.
|
|
1057
|
+
*/
|
|
1058
|
+
function startEventLoopStallMonitor(logger, reportThresholdMs = STALL_REPORT_MS) {
|
|
1059
|
+
let gc = {
|
|
1060
|
+
totalMs: 0,
|
|
1061
|
+
count: 0,
|
|
1062
|
+
longestMs: 0
|
|
1063
|
+
};
|
|
1064
|
+
let observer = null;
|
|
1065
|
+
try {
|
|
1066
|
+
observer = new node_perf_hooks.PerformanceObserver((list) => {
|
|
1067
|
+
for (const entry of list.getEntries()) {
|
|
1068
|
+
gc.totalMs += entry.duration;
|
|
1069
|
+
gc.count += 1;
|
|
1070
|
+
if (entry.duration > gc.longestMs) gc.longestMs = entry.duration;
|
|
1071
|
+
}
|
|
1072
|
+
});
|
|
1073
|
+
observer.observe({ entryTypes: ["gc"] });
|
|
1074
|
+
} catch {
|
|
1075
|
+
observer = null;
|
|
1076
|
+
}
|
|
1077
|
+
let expected = Date.now() + STALL_TICK_MS;
|
|
1078
|
+
const timer = setInterval(() => {
|
|
1079
|
+
const now = Date.now();
|
|
1080
|
+
const lateBy = now - expected;
|
|
1081
|
+
const window = gc;
|
|
1082
|
+
gc = {
|
|
1083
|
+
totalMs: 0,
|
|
1084
|
+
count: 0,
|
|
1085
|
+
longestMs: 0
|
|
1086
|
+
};
|
|
1087
|
+
expected = now + STALL_TICK_MS;
|
|
1088
|
+
if (lateBy < reportThresholdMs) return;
|
|
1089
|
+
const verdict = attributeStall(lateBy, Math.round(window.totalMs), window.count, Math.round(window.longestMs));
|
|
1090
|
+
const mem = process.memoryUsage();
|
|
1091
|
+
logger.warn("event loop stalled", { meta: {
|
|
1092
|
+
stallMs: verdict.stallMs,
|
|
1093
|
+
cause: verdict.cause,
|
|
1094
|
+
gcMs: verdict.gcMs,
|
|
1095
|
+
gcCount: verdict.gcCount,
|
|
1096
|
+
longestGcMs: verdict.longestGcMs,
|
|
1097
|
+
gcObserved: observer !== null,
|
|
1098
|
+
heapUsedMb: Math.round(mem.heapUsed / 1e6),
|
|
1099
|
+
heapTotalMb: Math.round(mem.heapTotal / 1e6),
|
|
1100
|
+
rssMb: Math.round(mem.rss / 1e6),
|
|
1101
|
+
externalMb: Math.round(mem.external / 1e6),
|
|
1102
|
+
arrayBuffersMb: Math.round(mem.arrayBuffers / 1e6)
|
|
1103
|
+
} });
|
|
1104
|
+
}, STALL_TICK_MS);
|
|
1105
|
+
timer.unref?.();
|
|
1106
|
+
let stopped = false;
|
|
1107
|
+
return () => {
|
|
1108
|
+
if (stopped) return;
|
|
1109
|
+
stopped = true;
|
|
1110
|
+
clearInterval(timer);
|
|
1111
|
+
observer?.disconnect();
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
//#endregion
|
|
978
1115
|
Object.defineProperty(exports, "ModelDownloadService", {
|
|
979
1116
|
enumerable: true,
|
|
980
1117
|
get: function() {
|
|
981
1118
|
return ModelDownloadService;
|
|
982
1119
|
}
|
|
983
1120
|
});
|
|
1121
|
+
Object.defineProperty(exports, "STALL_REPORT_MS", {
|
|
1122
|
+
enumerable: true,
|
|
1123
|
+
get: function() {
|
|
1124
|
+
return STALL_REPORT_MS;
|
|
1125
|
+
}
|
|
1126
|
+
});
|
|
1127
|
+
Object.defineProperty(exports, "STALL_TICK_MS", {
|
|
1128
|
+
enumerable: true,
|
|
1129
|
+
get: function() {
|
|
1130
|
+
return STALL_TICK_MS;
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1133
|
+
Object.defineProperty(exports, "attributeStall", {
|
|
1134
|
+
enumerable: true,
|
|
1135
|
+
get: function() {
|
|
1136
|
+
return attributeStall;
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
984
1139
|
Object.defineProperty(exports, "collectModelFiles", {
|
|
985
1140
|
enumerable: true,
|
|
986
1141
|
get: function() {
|
|
@@ -1065,3 +1220,9 @@ Object.defineProperty(exports, "resolveFilePath", {
|
|
|
1065
1220
|
return resolveFilePath;
|
|
1066
1221
|
}
|
|
1067
1222
|
});
|
|
1223
|
+
Object.defineProperty(exports, "startEventLoopStallMonitor", {
|
|
1224
|
+
enumerable: true,
|
|
1225
|
+
get: function() {
|
|
1226
|
+
return startEventLoopStallMonitor;
|
|
1227
|
+
}
|
|
1228
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -54,6 +54,8 @@ export type { HeapDiagnosticDeps, HeapDiagnosticRequest, HeapSpaceReader, HeapSp
|
|
|
54
54
|
export { DECISIVE_HEAP_SPACES, emitHeapDiagnosticReport, formatHeapSpaces, HEAP_SPACE_REPORT_MIN_MB, heapSpaceField, readHeapSpaces, selectReportedSpaces, } from './kernel/heap-spaces.js';
|
|
55
55
|
export type { DeferredHeapWatchSink, HeapReclaimer, HeapReclaimOptions, HeapSample, HeapWatchProbes, HeapWatchSink, LoopDelayMeter, LoopDelaySample, RssBreakdown, RssBudgetOptions, RssBudgetState, RssGrowthShape, RunnerHeapWatchOptions, } from './kernel/heap-watch.js';
|
|
56
56
|
export { buildHeapSample, createDeferredHeapWatchSink, createLoopDelayMeter, createV8Reclaimer, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, hubMainRssBudget, describeRss, nextRssBudgetState, parseRssBudgetMb, reclaimIntervalMs, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, shouldReclaim, startHeapWatch, startRunnerHeapWatch, strandedMb, ZERO_LOOP_DELAY, } from './kernel/heap-watch.js';
|
|
57
|
+
export type { StallVerdict } from './kernel/event-loop-stall-monitor.js';
|
|
58
|
+
export { attributeStall, STALL_REPORT_MS, STALL_TICK_MS, startEventLoopStallMonitor, } from './kernel/event-loop-stall-monitor.js';
|
|
57
59
|
export type { AddonDataPlaneFacility, DataPlaneSink, } from './kernel/moleculer/addon-data-plane-facility.js';
|
|
58
60
|
export { createAddonDataPlaneFacility } from './kernel/moleculer/addon-data-plane-facility.js';
|
|
59
61
|
export type { ElementState, ElementStatus, } from './lifecycle/lifecycle-state-machine.js';
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ require("./builtins/storage-orchestrator/index.js");
|
|
|
25
25
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
26
26
|
require("./builtins/system-config/index.js");
|
|
27
27
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
28
|
-
const
|
|
28
|
+
const require_event_loop_stall_monitor = require("./event-loop-stall-monitor-DM9OAzy8.js");
|
|
29
29
|
const require_tls$1 = require("./tls-BxQlomxd.js");
|
|
30
30
|
const require_manifest_system_deps = require("./manifest-system-deps-DvY1bY_n.js");
|
|
31
31
|
const require_resource_monitor = require("./resource-monitor-CdnzxBLP.js");
|
|
@@ -95861,7 +95861,7 @@ exports.LokiDestination = require_builtins_loki_logging_index.LokiDestination$1;
|
|
|
95861
95861
|
exports.LokiLoggingAddon = require_builtins_loki_logging_index.LokiLoggingAddon$1;
|
|
95862
95862
|
exports.MAX_LEAF_VALIDITY_DAYS = require_tls$1.MAX_LEAF_VALIDITY_DAYS;
|
|
95863
95863
|
exports.METHOD_ACCESS_MAP = require_dist.METHOD_ACCESS_MAP;
|
|
95864
|
-
exports.ModelDownloadService =
|
|
95864
|
+
exports.ModelDownloadService = require_event_loop_stall_monitor.ModelDownloadService;
|
|
95865
95865
|
exports.NATIVE_PROVIDER_SERVICE_INFIX = require_manifest_system_deps.NATIVE_PROVIDER_SERVICE_INFIX;
|
|
95866
95866
|
exports.NATIVE_SCAN_DEPTH = NATIVE_SCAN_DEPTH;
|
|
95867
95867
|
exports.NativeMetricsAddon = require_builtins_native_metrics_native_metrics_addon.default;
|
|
@@ -95891,6 +95891,8 @@ exports.ReplEngine = ReplEngine;
|
|
|
95891
95891
|
exports.RingBuffer = RingBuffer;
|
|
95892
95892
|
exports.SERVER_AUTH_OID = require_tls$1.SERVER_AUTH_OID;
|
|
95893
95893
|
exports.SOCKET_PLANE_TOP_N = require_manifest_system_deps.SOCKET_PLANE_TOP_N;
|
|
95894
|
+
exports.STALL_REPORT_MS = require_event_loop_stall_monitor.STALL_REPORT_MS;
|
|
95895
|
+
exports.STALL_TICK_MS = require_event_loop_stall_monitor.STALL_TICK_MS;
|
|
95894
95896
|
exports.ScopedLogger = ScopedLogger;
|
|
95895
95897
|
exports.ScopedTokenManager = require_builtins_local_auth_local_auth_addon.ScopedTokenManager;
|
|
95896
95898
|
exports.SocketChannel = require_manifest_system_deps.SocketChannel;
|
|
@@ -95918,6 +95920,7 @@ exports.adaptBrokerToCluster = require_manifest_system_deps.adaptBrokerToCluster
|
|
|
95918
95920
|
exports.addonSettingsCapability = require_dist.addonSettingsCapability;
|
|
95919
95921
|
exports.allFamiliesListenHost = require_tls$1.allFamiliesListenHost;
|
|
95920
95922
|
exports.applyLanHttp = require_tls$1.applyLanHttp;
|
|
95923
|
+
exports.attributeStall = require_event_loop_stall_monitor.attributeStall;
|
|
95921
95924
|
exports.bindPendingLanHttp = require_tls$1.bindPendingLanHttp;
|
|
95922
95925
|
exports.bootstrapSchema = bootstrapSchema;
|
|
95923
95926
|
exports.brokerCallForCap = require_manifest_system_deps.brokerCallForCap;
|
|
@@ -95950,14 +95953,14 @@ exports.closeLanHttp = require_tls$1.closeLanHttp;
|
|
|
95950
95953
|
exports.clusterEventTopic = require_manifest_system_deps.clusterEventTopic;
|
|
95951
95954
|
exports.clusterSecretMatches = clusterSecretMatches;
|
|
95952
95955
|
exports.collectCertIdentity = require_tls$1.collectCertIdentity;
|
|
95953
|
-
exports.collectModelFiles =
|
|
95954
|
-
exports.contentTypeFor =
|
|
95956
|
+
exports.collectModelFiles = require_event_loop_stall_monitor.collectModelFiles;
|
|
95957
|
+
exports.contentTypeFor = require_event_loop_stall_monitor.contentTypeFor;
|
|
95955
95958
|
exports.copyDirRecursive = copyDirRecursive;
|
|
95956
95959
|
exports.copyExtraFileDirs = copyExtraFileDirs;
|
|
95957
95960
|
exports.createAddonContext = require_manifest_system_deps.createAddonContext;
|
|
95958
95961
|
exports.createAddonDataPlaneFacility = require_manifest_system_deps.createAddonDataPlaneFacility;
|
|
95959
95962
|
exports.createAddonService = require_manifest_system_deps.createAddonService;
|
|
95960
|
-
exports.createAuthenticatedFileServer =
|
|
95963
|
+
exports.createAuthenticatedFileServer = require_event_loop_stall_monitor.createAuthenticatedFileServer;
|
|
95961
95964
|
exports.createBroker = createBroker;
|
|
95962
95965
|
exports.createBrokerDeviceManagerApi = require_manifest_system_deps.createBrokerDeviceManagerApi;
|
|
95963
95966
|
exports.createCoreCapService = createCoreCapService;
|
|
@@ -95965,7 +95968,7 @@ exports.createDeferredHeapWatchSink = require_manifest_system_deps.createDeferre
|
|
|
95965
95968
|
exports.createDoorSettingsView = createDoorSettingsView;
|
|
95966
95969
|
exports.createEventPlaneMeter = require_manifest_system_deps.createEventPlaneMeter;
|
|
95967
95970
|
exports.createEventPlaneReader = require_manifest_system_deps.createEventPlaneReader;
|
|
95968
|
-
exports.createFileDataPlaneHandler =
|
|
95971
|
+
exports.createFileDataPlaneHandler = require_event_loop_stall_monitor.createFileDataPlaneHandler;
|
|
95969
95972
|
exports.createHubCapForwardService = require_hub_cap_forward.createHubCapForwardService;
|
|
95970
95973
|
exports.createHubService = createHubService;
|
|
95971
95974
|
exports.createKernelHwAccel = require_manifest_system_deps.createKernelHwAccel;
|
|
@@ -95986,7 +95989,7 @@ exports.createUdsEventBus = require_manifest_system_deps.createUdsEventBus;
|
|
|
95986
95989
|
exports.createUdsLogger = require_manifest_system_deps.createUdsLogger;
|
|
95987
95990
|
exports.createUdsLoggerWithControl = require_manifest_system_deps.createUdsLoggerWithControl;
|
|
95988
95991
|
exports.createV8Reclaimer = require_manifest_system_deps.createV8Reclaimer;
|
|
95989
|
-
exports.deleteModelFromDisk =
|
|
95992
|
+
exports.deleteModelFromDisk = require_event_loop_stall_monitor.deleteModelFromDisk;
|
|
95990
95993
|
exports.deriveAgentListenPort = deriveAgentListenPort;
|
|
95991
95994
|
exports.describeProviderKindDrift = describeProviderKindDrift;
|
|
95992
95995
|
exports.describeRss = require_manifest_system_deps.describeRss;
|
|
@@ -95999,8 +96002,8 @@ Object.defineProperty(exports, "downloadBinary", {
|
|
|
95999
96002
|
return _camstack_types_node.downloadBinary;
|
|
96000
96003
|
}
|
|
96001
96004
|
});
|
|
96002
|
-
exports.downloadFile =
|
|
96003
|
-
exports.downloadModel =
|
|
96005
|
+
exports.downloadFile = require_event_loop_stall_monitor.downloadFile;
|
|
96006
|
+
exports.downloadModel = require_event_loop_stall_monitor.downloadModel;
|
|
96004
96007
|
exports.emitDownForOwnedCaps = require_dist.emitDownForOwnedCaps;
|
|
96005
96008
|
exports.emitHeapDiagnosticReport = require_manifest_system_deps.emitHeapDiagnosticReport;
|
|
96006
96009
|
exports.encodeFrame = require_manifest_system_deps.encodeFrame;
|
|
@@ -96019,7 +96022,7 @@ Object.defineProperty(exports, "ensureFfmpeg", {
|
|
|
96019
96022
|
}
|
|
96020
96023
|
});
|
|
96021
96024
|
exports.ensureLibraryBuilt = ensureLibraryBuilt;
|
|
96022
|
-
exports.ensureModel =
|
|
96025
|
+
exports.ensureModel = require_event_loop_stall_monitor.ensureModel;
|
|
96023
96026
|
exports.ensureNativePrebuilds = ensureNativePrebuilds;
|
|
96024
96027
|
Object.defineProperty(exports, "ensurePython", {
|
|
96025
96028
|
enumerable: true,
|
|
@@ -96030,7 +96033,7 @@ Object.defineProperty(exports, "ensurePython", {
|
|
|
96030
96033
|
exports.ensureTlsCert = require_tls$1.ensureTlsCert;
|
|
96031
96034
|
exports.evaluateExistingCert = require_tls$1.evaluateExistingCert;
|
|
96032
96035
|
exports.expandCapMethods = require_dist.expandCapMethods;
|
|
96033
|
-
exports.fetchJson =
|
|
96036
|
+
exports.fetchJson = require_event_loop_stall_monitor.fetchJson;
|
|
96034
96037
|
Object.defineProperty(exports, "findInPath", {
|
|
96035
96038
|
enumerable: true,
|
|
96036
96039
|
get: function() {
|
|
@@ -96050,7 +96053,7 @@ Object.defineProperty(exports, "getFfmpegDownloadUrl", {
|
|
|
96050
96053
|
}
|
|
96051
96054
|
});
|
|
96052
96055
|
exports.getLoggingGate = getLoggingGate;
|
|
96053
|
-
exports.getModelFilePath =
|
|
96056
|
+
exports.getModelFilePath = require_event_loop_stall_monitor.getModelFilePath;
|
|
96054
96057
|
exports.getMoleculerEventStats = require_manifest_system_deps.getMoleculerEventStats;
|
|
96055
96058
|
exports.getOrInitReadinessRegistry = require_manifest_system_deps.getOrInitReadinessRegistry;
|
|
96056
96059
|
exports.getOrInitReadinessRegistryForClient = require_manifest_system_deps.getOrInitReadinessRegistryForClient;
|
|
@@ -96096,7 +96099,7 @@ exports.isArrayOutputSchema = require_dist.isArrayOutputSchema;
|
|
|
96096
96099
|
exports.isClusterSecretMismatchError = isClusterSecretMismatchError;
|
|
96097
96100
|
exports.isCollectionArrayMethod = require_dist.isCollectionArrayMethod;
|
|
96098
96101
|
exports.isInfraCapability = isInfraCapability;
|
|
96099
|
-
exports.isModelDownloaded =
|
|
96102
|
+
exports.isModelDownloaded = require_event_loop_stall_monitor.isModelDownloaded;
|
|
96100
96103
|
exports.isSourceNewer = isSourceNewer;
|
|
96101
96104
|
exports.isolatedBuiltinPhase = isolatedBuiltinPhase;
|
|
96102
96105
|
exports.loadTlsCert = require_tls$1.loadTlsCert;
|
|
@@ -96105,9 +96108,9 @@ exports.localProviderLink = require_manifest_system_deps.localProviderLink;
|
|
|
96105
96108
|
exports.mountNativeCapService = require_manifest_system_deps.mountNativeCapService;
|
|
96106
96109
|
exports.nextRssBudgetState = require_manifest_system_deps.nextRssBudgetState;
|
|
96107
96110
|
exports.parseCapAction = require_manifest_system_deps.parseCapAction;
|
|
96108
|
-
exports.parseRangeHeader =
|
|
96111
|
+
exports.parseRangeHeader = require_event_loop_stall_monitor.parseRangeHeader;
|
|
96109
96112
|
exports.parseRssBudgetMb = require_manifest_system_deps.parseRssBudgetMb;
|
|
96110
|
-
exports.parseTokenizedUrl =
|
|
96113
|
+
exports.parseTokenizedUrl = require_event_loop_stall_monitor.parseTokenizedUrl;
|
|
96111
96114
|
exports.partitionIsolatedBuiltinIds = partitionIsolatedBuiltinIds;
|
|
96112
96115
|
exports.proxyToUpstream = proxyToUpstream;
|
|
96113
96116
|
exports.quarantineAddonResidue = quarantineAddonResidue;
|
|
@@ -96124,7 +96127,7 @@ exports.recordSocketFrame = require_manifest_system_deps.recordSocketFrame;
|
|
|
96124
96127
|
exports.registerEventBusService = require_manifest_system_deps.registerEventBusService;
|
|
96125
96128
|
exports.registerLanHttpHandler = require_tls$1.registerLanHttpHandler;
|
|
96126
96129
|
exports.reissueTlsLeaf = require_tls$1.reissueTlsLeaf;
|
|
96127
|
-
exports.resolveFilePath =
|
|
96130
|
+
exports.resolveFilePath = require_event_loop_stall_monitor.resolveFilePath;
|
|
96128
96131
|
exports.resolveHwAccel = require_manifest_system_deps.resolveHwAccel;
|
|
96129
96132
|
exports.resolveNpmInvocation = require_manifest_system_deps.resolveNpmInvocation;
|
|
96130
96133
|
exports.runHubAddonBoot = runHubAddonBoot;
|
|
@@ -96142,6 +96145,7 @@ exports.setNodeEventInterest = require_manifest_system_deps.setNodeEventInterest
|
|
|
96142
96145
|
exports.shouldReclaim = require_manifest_system_deps.shouldReclaim;
|
|
96143
96146
|
exports.socketDirectionBytes = require_manifest_system_deps.socketDirectionBytes;
|
|
96144
96147
|
exports.socketDirectionMessages = require_manifest_system_deps.socketDirectionMessages;
|
|
96148
|
+
exports.startEventLoopStallMonitor = require_event_loop_stall_monitor.startEventLoopStallMonitor;
|
|
96145
96149
|
exports.startHeapWatch = require_manifest_system_deps.startHeapWatch;
|
|
96146
96150
|
exports.startRunnerHeapWatch = require_manifest_system_deps.startRunnerHeapWatch;
|
|
96147
96151
|
exports.strandedMb = require_manifest_system_deps.strandedMb;
|
package/dist/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import "./builtins/storage-orchestrator/index.mjs";
|
|
|
24
24
|
import { SystemConfigAddon } from "./builtins/system-config/system-config.addon.mjs";
|
|
25
25
|
import "./builtins/system-config/index.mjs";
|
|
26
26
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
27
|
-
import { a as
|
|
27
|
+
import { _ as fetchJson, a as createFileDataPlaneHandler, c as parseRangeHeader, d as ModelDownloadService, f as collectModelFiles, g as ensureModel, h as downloadModel, i as startEventLoopStallMonitor, l as parseTokenizedUrl, m as downloadFile, n as STALL_TICK_MS, o as contentTypeFor, p as deleteModelFromDisk, r as attributeStall, s as createAuthenticatedFileServer, t as STALL_REPORT_MS, u as resolveFilePath, v as getModelFilePath, y as isModelDownloaded } from "./event-loop-stall-monitor-B3CFd9tM.mjs";
|
|
28
28
|
import { C as registerLanHttpHandler, S as readLanHttpState, _ as DEFAULT_LAN_HTTP_PORT, a as writeTlsMode, b as bindPendingLanHttp, c as loadTlsCert, d as collectCertIdentity, f as CA_VALIDITY_DAYS, g as evaluateExistingCert, h as SERVER_AUTH_OID, i as writeExtraSans, l as reissueTlsLeaf, m as MAX_LEAF_VALIDITY_DAYS, n as readTlsAccessStatus, o as validateUploadedTls, p as LEAF_RENEWAL_WINDOW_DAYS, r as readTlsMode, s as ensureTlsCert, t as readExtraSans, u as CA_COMMON_NAME, v as allFamiliesListenHost, x as closeLanHttp, y as applyLanHttp } from "./tls-DOTmtLCW.mjs";
|
|
29
29
|
import { $ as buildUdsNativeCapProxy, $t as formatHeapSpaces, A as createUdsLoggerWithControl, At as HUB_MAIN_RSS_BUDGET_MB, B as readMoleculerFanoutMode, Bt as createV8Reclaimer, C as ipcParentLink, Ct as createAddonDataPlaneFacility, D as createUdsEventBus, Dt as HEAP_WATCH_INTERVAL_MS, E as createUdsEventBridge, Et as HEAP_RECLAIM_TRIGGER_MB, F as AGENT_CAP_FWD_SERVICE, Ft as RUNNER_RSS_BUDGET_ENV, G as createLocalTransport, Gt as reclaimIntervalMs, H as PARENT_ROUTED_PROVIDER_ADDON_ID, Ht as hubMainRssBudget, I as CapRouteResolver, It as ZERO_LOOP_DELAY, J as SocketChannel, Jt as startRunnerHeapWatch, K as UdsLocalTransportClient, Kt as shouldReclaim, L as CapRouteError, Lt as buildHeapSample, M as LocalChildRegistry, Mt as RSS_BUDGET_REANNOUNCE_MIN_MS, N as UDS_NO_ROUTE_PREFIX, Nt as RSS_BUDGET_RELEASE_RATIO, O as udsChildLogToWorkerEntry, Ot as HEAP_WATCH_WARN_RATIO, P as AGENT_CAP_FWD_ACTION, Pt as RUNNER_HEAP_WATCH_INTERVAL_MS, Q as buildNativeCapProxy, Qt as emitHeapDiagnosticReport, R as classifyCapRoute, Rt as createDeferredHeapWatchSink, S as buildLinkChain, St as runNpm, T as createParentUnownedCallHandler, Tt as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, U as __resetCapUsageRegistryForTests, Ut as nextRssBudgetState, V as CapUsageRegistry, Vt as describeRss, W as getCapUsageRegistry, Wt as parseRssBudgetMb, X as FrameDecoder, Xt as DECISIVE_HEAP_SPACES, Y as localEndpointPath, Yt as strandedMb, Z as encodeFrame, Zt as HEAP_SPACE_REPORT_MIN_MB, _ as AddonDepsManager, _n as createEventPlaneReader, _t as CapabilityUnavailableError, a as createUdsAddonContext, an as createSocketPlaneMeter, at as createAddonService, b as brokerCallForCap, bt as resolveAddonClass, c as getOrInitReadinessRegistryForClient, cn as formatSocketPlane, ct as capActionName, d as clusterEventTopic, dn as recordSocketFrame, dt as capServiceName, en as heapSpaceField, et as createBrokerDeviceManagerApi, f as getBrokerEventBus, fn as sampleSocketDirection, ft as parseCapAction, g as subscribePassthrough, gn as createEventPlaneMeter, gt as CapabilityHandle, h as setNodeEventInterest, hn as EVENT_PLANE_TOP_N, ht as DeviceRegistry, i as createAddonContext, in as SOCKET_PLANE_TOP_N, j as LocalChildClient, jt as HUB_RSS_BUDGET_ENV, k as createUdsLogger, kt as HUB_MAIN_HEAP_WATCH_LABEL, l as setHubConnected, ln as EMPTY_SOCKET_DIRECTION, lt as capActionSuffix, m as registerEventBusService, mn as socketDirectionMessages, mt as serializeTypedArrays, n as installManifestPythonDeps, nn as selectReportedSpaces, o as getWorkerDeviceRegistry, on as createSocketPlaneReader, ot as validateProviderRegistrations, p as getMoleculerEventStats, pn as socketDirectionBytes, pt as deserializeTypedArrays, q as UdsLocalTransportServer, qt as startHeapWatch, r as adaptBrokerToCluster, rn as EMPTY_SOCKET_PLANE_BASELINE, rt as mountNativeCapService, s as getOrInitReadinessRegistry, sn as diffSocketPlane, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestSystemDeps, tn as readHeapSpaces, u as EVENT_TOPIC_PREFIX, un as createSocketDirectionCounters, ut as capBareAction, v as createKernelHwAccel, vn as diffEventPlane, vt as copyBundledNativeModules, w as localProviderLink, wt as HEAP_RECLAIM_MIN_INTERVAL_MS, x as brokerTransportLink, xt as resolveNpmInvocation, y as resolveHwAccel, yn as formatEventPlane, yt as installManifestNativeDeps, z as callWithServiceDiscovery, zt as createLoopDelayMeter } from "./manifest-system-deps-726RBOX7.mjs";
|
|
30
30
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-BWmQ5i-o.mjs";
|
|
@@ -95766,4 +95766,4 @@ var LifecycleJobEngine = class {
|
|
|
95766
95766
|
}
|
|
95767
95767
|
};
|
|
95768
95768
|
//#endregion
|
|
95769
|
-
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LokiDestination, LokiLoggingAddon, MAX_LEAF_VALIDITY_DAYS, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PARENT_ROUTED_PROVIDER_ADDON_ID, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createLoopDelayMeter, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatEventPlane, formatHeapSpaces, formatLogLine, formatSocketPlane, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, nextRssBudgetState, parseCapAction, parseRangeHeader, parseRssBudgetMb, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readHeapSpaces, readLanHttpState, readMoleculerFanoutMode, readPendingRestart, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, socketDirectionBytes, socketDirectionMessages, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
|
95769
|
+
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LokiDestination, LokiLoggingAddon, MAX_LEAF_VALIDITY_DAYS, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PARENT_ROUTED_PROVIDER_ADDON_ID, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, attributeStall, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createLoopDelayMeter, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatEventPlane, formatHeapSpaces, formatLogLine, formatSocketPlane, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, nextRssBudgetState, parseCapAction, parseRangeHeader, parseRssBudgetMb, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readHeapSpaces, readLanHttpState, readMoleculerFanoutMode, readPendingRestart, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, socketDirectionBytes, socketDirectionMessages, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IScopedLogger } from '@camstack/types';
|
|
2
|
+
/** Tick period. Small enough to bound attribution error, large enough to cost
|
|
3
|
+
* nothing on a process already doing frame work. */
|
|
4
|
+
export declare const STALL_TICK_MS = 1000;
|
|
5
|
+
/**
|
|
6
|
+
* Report a freeze only past this. The runner's own inference deadline is 20s
|
|
7
|
+
* and the observed freezes run 22-88s, so this is far below the signal while
|
|
8
|
+
* staying clear of ordinary scheduling jitter (a busy frame path routinely
|
|
9
|
+
* overruns a 1s timer by tens of ms).
|
|
10
|
+
*/
|
|
11
|
+
export declare const STALL_REPORT_MS = 2000;
|
|
12
|
+
export interface StallVerdict {
|
|
13
|
+
/** How long the loop was actually blocked. */
|
|
14
|
+
readonly stallMs: number;
|
|
15
|
+
/** GC pause time inside the stall window. */
|
|
16
|
+
readonly gcMs: number;
|
|
17
|
+
/** Number of GC pauses in the window. */
|
|
18
|
+
readonly gcCount: number;
|
|
19
|
+
/** Longest single GC pause in the window. */
|
|
20
|
+
readonly longestGcMs: number;
|
|
21
|
+
/** What the evidence says. */
|
|
22
|
+
readonly cause: 'gc' | 'synchronous-block' | 'mixed';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Attribute a freeze. Pure, because this is the ONE judgement the whole module
|
|
26
|
+
* exists to make and it must be testable without freezing a real event loop.
|
|
27
|
+
*
|
|
28
|
+
* `gc` when garbage collection accounts for most of the stall; a
|
|
29
|
+
* `synchronous-block` when it accounts for almost none — that verdict points
|
|
30
|
+
* away from the heap entirely and at whatever ran without yielding.
|
|
31
|
+
*/
|
|
32
|
+
export declare function attributeStall(stallMs: number, gcMs: number, gcCount: number, longestGcMs: number): StallVerdict;
|
|
33
|
+
/**
|
|
34
|
+
* Start watching. Returns a stop function; safe to call twice.
|
|
35
|
+
*
|
|
36
|
+
* Never throws into the caller: a diagnostic that can take the detection
|
|
37
|
+
* process down is worse than no diagnostic. `PerformanceObserver` for `gc` is
|
|
38
|
+
* unavailable in some embedded runtimes, and that must degrade to
|
|
39
|
+
* stall-detection-without-attribution rather than a boot failure.
|
|
40
|
+
*/
|
|
41
|
+
export declare function startEventLoopStallMonitor(logger: IScopedLogger, reportThresholdMs?: number): () => void;
|