@hadoku/service-kernel 0.1.179 → 0.1.181
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { arrivedVia, busyHandler, isLocalProbe, type BusyReport, type BusyRun } from './busy.js';
|
|
2
2
|
export { bootClock } from './bootClock.js';
|
|
3
3
|
export { closeConnections, sendThenFlush, type Closable, type Flushable } from './flush-sockets.js';
|
|
4
|
+
export { toggleInspector } from './inspector.js';
|
|
4
5
|
export { allReleases, announceRelease, creditCounts, creditMark, creditsBody, creditsIn, CREDITS_TITLE, forDiscord, latestRelease, parseNotes, releaseEmbeds, showCredits, splitBody, type AnnounceOptions, type CreditCount, type Embed, type ReleaseNotes, type ReleaseOrdering, } from './announce.js';
|
|
5
6
|
export { archivebotPost, type ArchivebotReply, type ArchivebotTarget } from './archivebot.js';
|
package/dist/lifecycle/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { arrivedVia, busyHandler, isLocalProbe } from "./busy.js";
|
|
2
2
|
export { bootClock } from "./bootClock.js";
|
|
3
3
|
export { closeConnections, sendThenFlush } from "./flush-sockets.js";
|
|
4
|
+
export { toggleInspector } from "./inspector.js";
|
|
4
5
|
export { allReleases, announceRelease, creditCounts, creditMark, creditsBody, creditsIn, CREDITS_TITLE, forDiscord, latestRelease, parseNotes, releaseEmbeds, showCredits, splitBody, } from "./announce.js";
|
|
5
6
|
export { archivebotPost } from "./archivebot.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toggleInspector(log: (entry: Record<string, unknown>) => void): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SIGUSR1 opens the inspector, as it does in any node process, but on a free loopback port rather
|
|
3
|
+
* than node's fixed 9229, which another process on the host may already hold (a workerd did,
|
|
4
|
+
* so the default SIGUSR1 opened nothing). The port is in the log's `inspector-open` line; the next
|
|
5
|
+
* SIGUSR1 closes it. This is how a running server's heap is profiled without a restart (pre-prod
|
|
6
|
+
* 2026-11-28: a heap climbing ~12 MB/min under the soak). Loopback only: whoever can signal the
|
|
7
|
+
* process could already attach to it as the same user.
|
|
8
|
+
*/
|
|
9
|
+
import * as inspector from 'node:inspector';
|
|
10
|
+
export function toggleInspector(log) {
|
|
11
|
+
if (inspector.url() !== undefined) {
|
|
12
|
+
inspector.close();
|
|
13
|
+
log({ evt: 'inspector-closed' });
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
inspector.open(0, '127.0.0.1');
|
|
17
|
+
log({ evt: 'inspector-open', url: inspector.url() });
|
|
18
|
+
}
|
package/dist/server/server.js
CHANGED
|
@@ -60,7 +60,7 @@ import { capacitySampler } from "../capacity/index.js";
|
|
|
60
60
|
import { createAccountErase, ERASE_PATH, MERGE_PATH } from "../erase/index.js";
|
|
61
61
|
import { healthResponse, readCommit, serviceIdOf } from "../health/index.js";
|
|
62
62
|
import { checkBundle, isEmbedEntry, stampOrigin } from "../http/index.js";
|
|
63
|
-
import { bootClock, busyHandler, closeConnections, sendThenFlush } from "../lifecycle/index.js";
|
|
63
|
+
import { bootClock, busyHandler, closeConnections, sendThenFlush, toggleInspector } from "../lifecycle/index.js";
|
|
64
64
|
import { firstSeen, installTelemetry } from "../telemetry/index.js";
|
|
65
65
|
import { createBus } from "./bus.js";
|
|
66
66
|
export const PHASES = ['config', 'bundle', 'stores', 'routes', 'sockets', 'listen', 'warm'];
|
|
@@ -265,6 +265,7 @@ export async function createGameServer({ id, config, state, plugins }) {
|
|
|
265
265
|
if (config.signals ?? true) {
|
|
266
266
|
process.on('SIGTERM', () => void shutdown('SIGTERM'));
|
|
267
267
|
process.on('SIGINT', () => void shutdown('SIGINT'));
|
|
268
|
+
process.on('SIGUSR1', () => toggleInspector(config.log));
|
|
268
269
|
}
|
|
269
270
|
// After every socket.io attach: engine.io moves itself to the front of the request listeners.
|
|
270
271
|
stampOrigin(httpServer, config.origin ?? id);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hadoku/service-kernel",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "0.1.181",
|
|
4
|
+
"gitHead": "afa27e0259be9183567f91d2721182e87f533d1a",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "The server parts any game keeps: edge auth and the tier gate, base path and bundle check, health and the busy probe, lifecycle, the JSON logger, the state directory, telemetry and capacity, per-caller limits, the browser relays, the erase registry, and createGameServer, which boots a game from its config and plugins. Knows no game; the app binds its service id, prefix and env names. MIT; imports only node built-ins, express, socket.io, platform-wire and @wolffm/*.",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.
|
|
59
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.148",
|
|
60
60
|
"express": "^5.1.0",
|
|
61
61
|
"socket.io": "^4.8.3"
|
|
62
62
|
},
|