@camstack/server 1.2.186 → 1.2.188
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/main.js +30 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -262,7 +262,32 @@ async function bootstrap() {
|
|
|
262
262
|
// repointed at `LoggingService` the moment it exists (below), and boot lines keep going to
|
|
263
263
|
// stdout exactly as before. See `createDeferredHeapWatchSink`.
|
|
264
264
|
const heapWatchSink = (0, system_1.createDeferredHeapWatchSink)(system_1.HUB_MAIN_HEAP_WATCH_LABEL);
|
|
265
|
-
|
|
265
|
+
// ...and the event planes, which is the OTHER half of what this process is.
|
|
266
|
+
// hub-main's `arrayBuffers` is a rate, not a set: every forced compaction
|
|
267
|
+
// drops it to 12-29MB (ten passes out of ten, 2026-08-29), so the number to
|
|
268
|
+
// watch is the slope — 181-330MB/min steady, one burst of >=1.3GB in <=11s —
|
|
269
|
+
// and the traffic behind it is ~22 000 socket reads/s and ~22 500 writes/s at
|
|
270
|
+
// a 0.33KB mean. `LocalChildRegistry` has counted that per child since the
|
|
271
|
+
// fan-out gate was built and NOTHING has ever read it; `getMoleculerEventStats`
|
|
272
|
+
// likewise, while the hub runs `CAMSTACK_MOLECULER_EVENT_FANOUT=shadow` — a
|
|
273
|
+
// burn-in with no end condition, because the evidence that would authorise the
|
|
274
|
+
// flip to `filter` was never surfaced. This surfaces it and changes no default.
|
|
275
|
+
//
|
|
276
|
+
// Every source is read LAZILY: this runs as the first statement of bootstrap()
|
|
277
|
+
// and `MoleculerService` does not exist for hundreds of lines. Until it does,
|
|
278
|
+
// the reader reports `undefined` and the line carries no fan-out fields at all
|
|
279
|
+
// — a plane that does not exist yet must not be reported as a silent one.
|
|
280
|
+
let moleculerForEventPlane = null;
|
|
281
|
+
(0, system_1.startHeapWatch)(system_1.HUB_MAIN_HEAP_WATCH_LABEL, heapWatchSink.sink, undefined, heapReclaim, undefined, undefined, true, (0, system_1.hubMainRssBudget)(), {
|
|
282
|
+
eventPlane: (0, system_1.createEventPlaneReader)({
|
|
283
|
+
registry: () => moleculerForEventPlane?.childRegistry ?? null,
|
|
284
|
+
crossNodeStats: () => {
|
|
285
|
+
const broker = moleculerForEventPlane?.broker;
|
|
286
|
+
return broker === undefined ? null : (0, system_1.getMoleculerEventStats)(broker);
|
|
287
|
+
},
|
|
288
|
+
crossNodeMode: () => (0, system_1.readMoleculerFanoutMode)(),
|
|
289
|
+
}),
|
|
290
|
+
});
|
|
266
291
|
// Clean up orphaned processes from previous crashes before starting
|
|
267
292
|
cleanupOrphanProcesses();
|
|
268
293
|
// SPA fallback — set later when admin UI is resolved, used by addon route catch-all
|
|
@@ -479,6 +504,10 @@ async function bootstrap() {
|
|
|
479
504
|
// Register log-receiver service for agent log forwarding (after app.init
|
|
480
505
|
// so Moleculer re-advertises the service list to the network)
|
|
481
506
|
const moleculer = app.get(moleculer_service_1.MoleculerService);
|
|
507
|
+
// Hand the heartbeat its event-plane sources. The reader holds this by
|
|
508
|
+
// closure and re-reads `childRegistry` / `broker` on every line, so a registry
|
|
509
|
+
// that is rebuilt later is picked up without re-wiring anything.
|
|
510
|
+
moleculerForEventPlane = moleculer;
|
|
482
511
|
moleculer.registerLogReceiver();
|
|
483
512
|
// Hub-internal `model-distributor` provider — pushes a model format that is
|
|
484
513
|
// resident on the hub `/data/models` to an agent's `/data/models` (Model
|