@proteinjs/server 3.5.3 → 3.7.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 +22 -0
- package/dist/generated/index.js +1 -1
- package/dist/generated/index.js.map +1 -1
- package/dist/src/DevClientBuild.d.ts +6 -0
- package/dist/src/DevClientBuild.d.ts.map +1 -1
- package/dist/src/DevClientBuild.js.map +1 -1
- package/dist/src/GracefulShutdown.d.ts +56 -3
- package/dist/src/GracefulShutdown.d.ts.map +1 -1
- package/dist/src/GracefulShutdown.js +148 -7
- package/dist/src/GracefulShutdown.js.map +1 -1
- package/dist/src/routes/reactApp.d.ts.map +1 -1
- package/dist/src/routes/reactApp.js +65 -60
- package/dist/src/routes/reactApp.js.map +1 -1
- package/dist/src/startServer.js +17 -2
- package/dist/src/startServer.js.map +1 -1
- package/generated/index.ts +1 -1
- package/package.json +3 -3
- package/src/DevClientBuild.ts +6 -0
- package/src/GracefulShutdown.ts +133 -5
- package/src/routes/reactApp.ts +57 -31
- package/src/startServer.ts +16 -2
- package/test/fixture/gracefulShutdownServer.js +21 -2
- package/test/gracefulShutdown.test.ts +68 -1
- package/test/holdSeam.test.ts +82 -0
- package/test/reactAppBoot.test.ts +168 -0
|
@@ -55,18 +55,24 @@ var createReactApp = function (serverConfig) {
|
|
|
55
55
|
path: '*',
|
|
56
56
|
method: 'get',
|
|
57
57
|
onRequest: function (request, response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var helmet, _a,
|
|
59
|
-
var
|
|
60
|
-
return __generator(this, function (
|
|
61
|
-
switch (
|
|
58
|
+
var helmet, _a, serverRenderedScripts, bundleUrls;
|
|
59
|
+
var _b, _c, _d;
|
|
60
|
+
return __generator(this, function (_e) {
|
|
61
|
+
switch (_e.label) {
|
|
62
62
|
case 0:
|
|
63
63
|
if (request.path.startsWith('/static')) {
|
|
64
64
|
return [2 /*return*/];
|
|
65
65
|
}
|
|
66
|
-
if (!(((
|
|
66
|
+
if (!(((_b = serverConfig.staticContent) === null || _b === void 0 ? void 0 : _b.bundlePaths) || ((_c = serverConfig.staticContent) === null || _c === void 0 ? void 0 : _c.bundlesDir))) {
|
|
67
67
|
throw new Error("ServerConfig.bundlePath or ServerConfig.bundlesDir must be provided to serve a react app");
|
|
68
68
|
}
|
|
69
69
|
helmet = react_helmet_1.default.renderStatic();
|
|
70
|
+
return [4 /*yield*/, Promise.all([
|
|
71
|
+
serverRenderedScriptTags(),
|
|
72
|
+
bundleScriptUrls(serverConfig),
|
|
73
|
+
])];
|
|
74
|
+
case 1:
|
|
75
|
+
_a = _e.sent(), serverRenderedScripts = _a[0], bundleUrls = _a[1];
|
|
70
76
|
// The page must ALWAYS revalidate (found live 2026-09-01, the mobile-app stale-page
|
|
71
77
|
// investigation): without an explicit policy, HTTP heuristic caching applies (RFC 9111
|
|
72
78
|
// §4.2.2) — WKWebView in particular can serve the cached page without revalidating,
|
|
@@ -74,14 +80,7 @@ var createReactApp = function (serverConfig) {
|
|
|
74
80
|
// bundles under /static keep their long cache (a fresh page always points at fresh
|
|
75
81
|
// hashes); `no-cache` + the ETag express already stamps = a cheap 304 on every load.
|
|
76
82
|
response.set('Cache-Control', 'no-cache');
|
|
77
|
-
|
|
78
|
-
_e = (_d = "<!DOCTYPE html>\n <html ".concat(helmet.htmlAttributes, ">\n <head>\n <meta charset='utf-8' />\n <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1, viewport-fit=cover'>\n <meta name='theme-color' content='").concat(THEME_COLOR_LIGHT, "' media='(prefers-color-scheme: light)'>\n <meta name='theme-color' content='").concat(THEME_COLOR_DARK, "' media='(prefers-color-scheme: dark)'>\n <link href='").concat(((_j = serverConfig.staticContent) === null || _j === void 0 ? void 0 : _j.faviconPath) ? path_1.default.join('/static/', serverConfig.staticContent.faviconPath) : '', "' rel='icon' type='image/png' />\n ").concat(helmet.title.toString(), "\n ").concat(helmet.meta.toString(), "\n ").concat(helmet.link.toString(), "\n </head>\n <body ").concat(helmet.bodyAttributes.toString(), ">\n <div id='app'></div>\n <script>proteinjs = {};</script>\n ")).concat;
|
|
79
|
-
return [4 /*yield*/, serverRenderedScriptTags()];
|
|
80
|
-
case 1:
|
|
81
|
-
_f = (_c = _e.apply(_d, [_k.sent(), "\n "])).concat;
|
|
82
|
-
return [4 /*yield*/, bundleScriptTags(serverConfig)];
|
|
83
|
-
case 2:
|
|
84
|
-
_b.apply(_a, [_f.apply(_c, [_k.sent(), "\n </body>\n </html>"])]);
|
|
83
|
+
response.send("<!DOCTYPE html>\n <html ".concat(helmet.htmlAttributes, ">\n <head>\n <meta charset='utf-8' />\n <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1, viewport-fit=cover'>\n <meta name='theme-color' content='").concat(THEME_COLOR_LIGHT, "' media='(prefers-color-scheme: light)'>\n <meta name='theme-color' content='").concat(THEME_COLOR_DARK, "' media='(prefers-color-scheme: dark)'>\n <link href='").concat(((_d = serverConfig.staticContent) === null || _d === void 0 ? void 0 : _d.faviconPath) ? path_1.default.join('/static/', serverConfig.staticContent.faviconPath) : '', "' rel='icon' type='image/png' />\n ").concat(bundlePreloadTags(bundleUrls), "\n ").concat(helmet.title.toString(), "\n ").concat(helmet.meta.toString(), "\n ").concat(helmet.link.toString(), "\n </head>\n <body ").concat(helmet.bodyAttributes.toString(), ">\n <div id='app'></div>\n <script>proteinjs = {};</script>\n ").concat(serverRenderedScripts, "\n ").concat(bundleScriptTags(bundleUrls), "\n </body>\n </html>"));
|
|
85
84
|
return [2 /*return*/];
|
|
86
85
|
}
|
|
87
86
|
});
|
|
@@ -89,69 +88,75 @@ var createReactApp = function (serverConfig) {
|
|
|
89
88
|
};
|
|
90
89
|
};
|
|
91
90
|
exports.createReactApp = createReactApp;
|
|
92
|
-
|
|
91
|
+
/**
|
|
92
|
+
* The bundle URLs the page loads, in load order. Dev: the entrypoint's files as the LAST compile
|
|
93
|
+
* recorded them (DevClientBuild — the page follows the chunk graph the webpack config declares),
|
|
94
|
+
* each stamped `?v=<hash>` so the page is verifiable against /dev/build-info (matching hash =
|
|
95
|
+
* provably running the current build). Prod: the configured bundle paths, or every `.js` under the
|
|
96
|
+
* bundles dir in a stable (sorted) order — webpack's runtime registers chunks in any order.
|
|
97
|
+
*/
|
|
98
|
+
function bundleScriptUrls(serverConfig) {
|
|
93
99
|
var _a, _b, _c, _d, _e;
|
|
94
100
|
return __awaiter(this, void 0, void 0, function () {
|
|
95
|
-
var
|
|
96
|
-
return __generator(this, function (
|
|
97
|
-
switch (
|
|
101
|
+
var build_1, staticContentDir_1, resolvedBundlesDir, filePaths;
|
|
102
|
+
return __generator(this, function (_f) {
|
|
103
|
+
switch (_f.label) {
|
|
98
104
|
case 0:
|
|
99
105
|
if (!(((_a = serverConfig.staticContent) === null || _a === void 0 ? void 0 : _a.bundlePaths) || ((_b = serverConfig.staticContent) === null || _b === void 0 ? void 0 : _b.bundlesDir))) {
|
|
100
|
-
return [2 /*return
|
|
106
|
+
return [2 /*return*/, []];
|
|
101
107
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
for (_i = 0, _f = serverConfig.staticContent.bundlePaths; _i < _f.length; _i++) {
|
|
111
|
-
bundlePath = _f[_i];
|
|
112
|
-
scriptTags.push("<script src='".concat(path_1.default.join('/static/', bundlePath), "'></script>"));
|
|
108
|
+
if (process.env.DEVELOPMENT && !process.env.DISABLE_HOT_CLIENT_BUILDS) {
|
|
109
|
+
build_1 = DevClientBuild_1.DevClientBuild.get();
|
|
110
|
+
if (!build_1) {
|
|
111
|
+
// start() gates the listen READY on the first compile, so a page is never served before
|
|
112
|
+
// a build is recorded; a missing record is a wiring fault, said aloud rather than papered.
|
|
113
|
+
throw new Error('the dev client build has not been recorded yet — no bundle to serve');
|
|
114
|
+
}
|
|
115
|
+
return [2 /*return*/, build_1.assets.map(function (asset) { return "".concat(path_1.default.join('/static/', asset), "?v=").concat(build_1.hash); })];
|
|
113
116
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (!(((_d = serverConfig.staticContent) === null || _d === void 0 ? void 0 : _d.bundlesDir) && ((_e = serverConfig.staticContent) === null || _e === void 0 ? void 0 : _e.staticContentDir))) return [3 /*break*/, 4];
|
|
117
|
-
resolvedBundlesDir = path_1.default.join(serverConfig.staticContent.staticContentDir, serverConfig.staticContent.bundlesDir);
|
|
118
|
-
return [4 /*yield*/, util_node_1.Fs.getFilePathsMatchingGlob(resolvedBundlesDir, '**/*.js')];
|
|
119
|
-
case 3:
|
|
120
|
-
filePaths = _h.sent();
|
|
121
|
-
for (_g = 0, filePaths_1 = filePaths; _g < filePaths_1.length; _g++) {
|
|
122
|
-
filePath = filePaths_1[_g];
|
|
123
|
-
relativePath = path_1.default.relative(serverConfig.staticContent.staticContentDir, filePath);
|
|
124
|
-
scriptTags.push("<script src='".concat(path_1.default.join('/static/', relativePath), "'></script>"));
|
|
117
|
+
if ((_c = serverConfig.staticContent) === null || _c === void 0 ? void 0 : _c.bundlePaths) {
|
|
118
|
+
return [2 /*return*/, serverConfig.staticContent.bundlePaths.map(function (bundlePath) { return path_1.default.join('/static/', bundlePath); })];
|
|
125
119
|
}
|
|
126
|
-
|
|
127
|
-
|
|
120
|
+
if (!(((_d = serverConfig.staticContent) === null || _d === void 0 ? void 0 : _d.bundlesDir) && ((_e = serverConfig.staticContent) === null || _e === void 0 ? void 0 : _e.staticContentDir))) return [3 /*break*/, 2];
|
|
121
|
+
staticContentDir_1 = serverConfig.staticContent.staticContentDir;
|
|
122
|
+
resolvedBundlesDir = path_1.default.join(staticContentDir_1, serverConfig.staticContent.bundlesDir);
|
|
123
|
+
return [4 /*yield*/, util_node_1.Fs.getFilePathsMatchingGlob(resolvedBundlesDir, '**/*.js')];
|
|
124
|
+
case 1:
|
|
125
|
+
filePaths = _f.sent();
|
|
126
|
+
return [2 /*return*/, filePaths
|
|
127
|
+
.map(function (filePath) { return path_1.default.join('/static/', path_1.default.relative(staticContentDir_1, filePath)); })
|
|
128
|
+
.sort()];
|
|
129
|
+
case 2: return [2 /*return*/, []];
|
|
128
130
|
}
|
|
129
131
|
});
|
|
130
132
|
});
|
|
131
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* `defer`: the bundles download in parallel WHILE the HTML parses and execute in document order
|
|
136
|
+
* once it has — a synchronous `<script src>` blocked the parser on every byte of the vendor chunk,
|
|
137
|
+
* and on iOS the previous page stayed painted (and tappable) under the user's thumb until the new
|
|
138
|
+
* document's first paint. The inline server-rendered scripts above them still run at parse time,
|
|
139
|
+
* so `proteinjs[...]` globals exist before any bundle executes.
|
|
140
|
+
*/
|
|
141
|
+
function bundleScriptTags(bundleUrls) {
|
|
142
|
+
return bundleUrls.map(function (url) { return "<script defer src='".concat(url, "'></script>"); }).join('\n');
|
|
143
|
+
}
|
|
144
|
+
/** `<link rel=preload>` in the head: the fetches start from the first bytes of the document. */
|
|
145
|
+
function bundlePreloadTags(bundleUrls) {
|
|
146
|
+
return bundleUrls.map(function (url) { return "<link rel='preload' href='".concat(url, "' as='script'>"); }).join('\n');
|
|
147
|
+
}
|
|
148
|
+
/** Every server-rendered script rendered CONCURRENTLY; emitted in registration order. */
|
|
132
149
|
function serverRenderedScriptTags() {
|
|
133
150
|
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
-
var scripts,
|
|
135
|
-
return __generator(this, function (
|
|
136
|
-
switch (
|
|
151
|
+
var scripts, rendered;
|
|
152
|
+
return __generator(this, function (_a) {
|
|
153
|
+
switch (_a.label) {
|
|
137
154
|
case 0:
|
|
138
155
|
scripts = (0, server_api_1.getServerRenderedScripts)();
|
|
139
|
-
|
|
140
|
-
_i = 0, scripts_1 = scripts;
|
|
141
|
-
_d.label = 1;
|
|
156
|
+
return [4 /*yield*/, Promise.all(scripts.map(function (script) { return script.script(); }))];
|
|
142
157
|
case 1:
|
|
143
|
-
|
|
144
|
-
script
|
|
145
|
-
_b = (_a = scriptTags).push;
|
|
146
|
-
_c = "<script>".concat;
|
|
147
|
-
return [4 /*yield*/, script.script()];
|
|
148
|
-
case 2:
|
|
149
|
-
_b.apply(_a, [_c.apply("<script>", [_d.sent(), "</script>"])]);
|
|
150
|
-
_d.label = 3;
|
|
151
|
-
case 3:
|
|
152
|
-
_i++;
|
|
153
|
-
return [3 /*break*/, 1];
|
|
154
|
-
case 4: return [2 /*return*/, scriptTags.join('\n')];
|
|
158
|
+
rendered = _a.sent();
|
|
159
|
+
return [2 /*return*/, rendered.map(function (script) { return "<script>".concat(script, "</script>"); }).join('\n')];
|
|
155
160
|
}
|
|
156
161
|
});
|
|
157
162
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactApp.js","sourceRoot":"","sources":["../../../src/routes/reactApp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAwB;AACxB,8DAAuC;AACvC,oDAA+E;AAC/E,kDAA0C;AAC1C,oDAAmD;AAEnD,iFAAiF;AACjF,mFAAmF;AACnF,kEAAkE;AAClE,IAAM,iBAAiB,GAAG,SAAS,CAAC;AACpC,IAAM,gBAAgB,GAAG,SAAS,CAAC;AAE5B,IAAM,cAAc,GAAG,UAAC,YAA0B;IACvD,OAAO;QACL,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,KAAc;QACtB,SAAS,EAAE,UAAO,OAAY,EAAE,QAAa;;;;;;wBAC3C,IAAI,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;4BACtC,sBAAO;yBACR;wBAED,IAAI,CAAC,CAAC,CAAA,MAAA,YAAY,CAAC,aAAa,0CAAE,WAAW,MAAI,MAAA,YAAY,CAAC,aAAa,0CAAE,UAAU,CAAA,CAAC,EAAE;4BACxF,MAAM,IAAI,KAAK,CAAC,0FAA0F,CAAC,CAAC;yBAC7G;wBAEK,MAAM,GAAG,sBAAW,CAAC,YAAY,E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yF;AACzF,SAAe,wBAAwB;;;;;;oBAC/B,OAAO,GAAG,IAAA,qCAAwB,GAAE,CAAC;oBAC1B,qBAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,UAAC,MAAM,IAAK,OAAA,MAAM,CAAC,MAAM,EAAE,EAAf,CAAe,CAAC,CAAC,EAAA;;oBAAtE,QAAQ,GAAG,SAA2D;oBAC5E,sBAAO,QAAQ,CAAC,GAAG,CAAC,UAAC,MAAM,IAAK,OAAA,kBAAW,MAAM,cAAW,EAA5B,CAA4B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC;;;;CAC1E"}
|
package/dist/src/startServer.js
CHANGED
|
@@ -222,9 +222,24 @@ function initializeHotReloading(app, config) {
|
|
|
222
222
|
// and logged, so "which build is this page running?" is answerable instead of guessable.
|
|
223
223
|
compiler.hooks.done.tap('proteinjs-server', function (stats) {
|
|
224
224
|
var _a;
|
|
225
|
-
var _b = stats.toJson({
|
|
225
|
+
var _b = stats.toJson({
|
|
226
|
+
all: false,
|
|
227
|
+
hash: true,
|
|
228
|
+
timings: true,
|
|
229
|
+
errors: true,
|
|
230
|
+
entrypoints: true,
|
|
231
|
+
chunkGroupAssets: true,
|
|
232
|
+
}), hash = _b.hash, time = _b.time, errors = _b.errors, entrypoints = _b.entrypoints;
|
|
226
233
|
var errorCount = (_a = errors === null || errors === void 0 ? void 0 : errors.length) !== null && _a !== void 0 ? _a : 0;
|
|
227
|
-
|
|
234
|
+
// The entrypoint's script files in the compile's own load order — what the dev page's bundle
|
|
235
|
+
// tags render (reactApp.ts). Source maps and hot-update chunks are not entrypoint files.
|
|
236
|
+
var assets = Object.values(entrypoints !== null && entrypoints !== void 0 ? entrypoints : {}).flatMap(function (entrypoint) {
|
|
237
|
+
var _a;
|
|
238
|
+
return ((_a = entrypoint.assets) !== null && _a !== void 0 ? _a : [])
|
|
239
|
+
.map(function (asset) { return (typeof asset === 'string' ? asset : asset.name); })
|
|
240
|
+
.filter(function (name) { return name.endsWith('.js'); });
|
|
241
|
+
});
|
|
242
|
+
DevClientBuild_1.DevClientBuild.record({ hash: hash, builtAt: new Date().toISOString(), durationMs: time, errorCount: errorCount, assets: assets });
|
|
228
243
|
if (errorCount > 0) {
|
|
229
244
|
logger.error({ message: "Client bundle compiled WITH ERRORS", obj: { hash: hash, durationMs: time, errorCount: errorCount } });
|
|
230
245
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startServer.js","sourceRoot":"","sources":["../../src/startServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAwB;AACxB,iCAAuC;AACvC,oDAA8B;AAC9B,oEAA6C;AAC7C,gEAAyC;AACzC,4DAAqC;AACrC,sDAAgC;AAChC,kEAA2C;AAC3C,6BAA8E;AAC9E,oDAQ+B;AAC/B,2CAAgE;AAChE,4CAA2C;AAC3C,2DAA0E;AAC1E,mDAAkD;AAClD,uDAAsD;AAEtD,IAAM,iBAAiB,GAAG,UAAU,CAAC;AACrC,IAAM,MAAM,GAAG,IAAI,eAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC9C,IAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;AACtB,IAAM,MAAM,GAAG,IAAI,aAAU,CAAC,GAAG,CAAC,CAAC;AAEnC,+FAA+F;AAC/F,mGAAmG;AACnG,kGAAkG;AAClG,kGAAkG;AAClG,kGAAkG;AAClG,8FAA8F;AAC9F,gGAAgG;AAChG,kGAAkG;AAClG,8BAA8B;AAC9B,IAAM,kBAAkB,GAAG,MAAO,CAAC;AACnC,IAAM,qBAAqB,GAAG,kBAAkB,GAAG,KAAM,CAAC,CAAC,qCAAqC;AAChG,IAAM,kBAAkB,GAAG,qBAAqB,GAAG,IAAK,CAAC,CAAC,kCAAkC;AAC5F,MAAM,CAAC,gBAAgB,GAAG,qBAAqB,CAAC;AAChD,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AAG,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5G,6FAA6F;IAC7F,gGAAgG;IAChG,iGAAiG;IACjG,4FAA4F;IAC5F,8FAA8F;IAC9F,4FAA4F;IAC5F,8FAA8F;IAC9F,wFAAwF;IACxF,wFAAwF;IACxF,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QAClB,IAAM,QAAQ,GAAG;YACf,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;gBAC3B,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC,CAAC;aAC1D;YAED,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,oCAA6B,IAAI,CAAE,EAAE,CAAC,CAAC;QAChE,CAAC,CAAC;QAEF,IAAI,gBAAgB,EAAE;YACpB,MAAM,CAAC,IAAI,CAAC;gBACV,OAAO,EAAE,4BAAqB,IAAI,yEAAsE;aACzG,CAAC,CAAC;YACH,KAAK,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrC,OAAO;SACR;QAED,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/generated/index.ts
CHANGED
|
@@ -21,7 +21,7 @@ import 'typescript';
|
|
|
21
21
|
/** Generate Source Graph */
|
|
22
22
|
|
|
23
23
|
const sourceGraph =
|
|
24
|
-
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"@proteinjs/server/NodeGlobalDataStorage","value":{"packageName":"@proteinjs/server","name":"NodeGlobalDataStorage","filePath":"/home/runner/work/server/server/packages/server/src/NodeGlobalDataStorage.ts","qualifiedName":"@proteinjs/server/NodeGlobalDataStorage","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"HOOK_INITIALIZED","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"GLOBAL_DATA","type":{"packageName":"@proteinjs/server","name":"{ [id: string]: GlobalData }","filePath":null,"qualifiedName":"@proteinjs/server/{ [id: string]: GlobalData }","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"environment","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"setData","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"data","type":{"packageName":"@proteinjs/server-api","name":"GlobalData","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalData","typeParameters":null,"directParents":null}}]},{"name":"getData","returnType":{"packageName":"@proteinjs/server-api","name":"GlobalData","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalData","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"initHook","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/server-api","name":"GlobalDataStorage","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalDataStorage","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/server-api/GlobalDataStorage"},{"v":"@proteinjs/server/NodeSessionDataStorage","value":{"packageName":"@proteinjs/server","name":"NodeSessionDataStorage","filePath":"/home/runner/work/server/server/packages/server/src/NodeSessionDataStorage.ts","qualifiedName":"@proteinjs/server/NodeSessionDataStorage","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"HOOK_INITIALIZED","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"SESSION_DATA","type":{"packageName":"@proteinjs/server","name":"{ [id: string]: SessionData }","filePath":null,"qualifiedName":"@proteinjs/server/{ [id: string]: SessionData }","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"environment","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"setData","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"data","type":{"packageName":"@proteinjs/server-api","name":"SessionData","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionData","typeParameters":null,"directParents":null}}]},{"name":"getData","returnType":{"packageName":"@proteinjs/server-api","name":"SessionData","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionData","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"clearData","returnType":{"packageName":"","name":"void","filePath":null,"qualifiedName":"/void","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"initHook","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/server-api","name":"SessionDataStorage","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionDataStorage","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/server-api/SessionDataStorage"},{"v":"@proteinjs/server/ExtendedIncomingMessage","value":{"packageName":"@proteinjs/server","name":"ExtendedIncomingMessage","filePath":"/home/runner/work/server/server/packages/server/src/SocketIOServerRepo.ts","qualifiedName":"@proteinjs/server/ExtendedIncomingMessage","properties":[{"name":"sessionID","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"user","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParents":[{"packageName":"http","name":"IncomingMessage","filePath":null,"qualifiedName":"http/IncomingMessage","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"sourceType":3}},{"v":"http/IncomingMessage"},{"v":"@proteinjs/server/ExtendedSocket","value":{"packageName":"@proteinjs/server","name":"ExtendedSocket","filePath":"/home/runner/work/server/server/packages/server/src/SocketIOServerRepo.ts","qualifiedName":"@proteinjs/server/ExtendedSocket","properties":[{"name":"request","type":{"packageName":"@proteinjs/server","name":"ExtendedIncomingMessage","filePath":null,"qualifiedName":"@proteinjs/server/ExtendedIncomingMessage","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParents":[{"packageName":"socket.io","name":"Socket","filePath":null,"qualifiedName":"socket.io/Socket","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"sourceType":3}},{"v":"socket.io/Socket"},{"v":"@proteinjs/server/environmentCache","value":{"packageName":"@proteinjs/server","name":"environmentCache","filePath":"/home/runner/work/server/server/packages/server/src/envCache.ts","qualifiedName":"@proteinjs/server/environmentCache","type":{"packageName":"","name":"GlobalDataCache<Env>","filePath":null,"qualifiedName":"/GlobalDataCache<Env>","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"GlobalDataCache","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalDataCache","typeParameters":["@proteinjs/server-api/Env"],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/GlobalDataCache"},{"v":"@proteinjs/server/healthCheck","value":{"packageName":"@proteinjs/server","name":"healthCheck","filePath":"/home/runner/work/server/server/packages/server/src/routes/healthCheck.ts","qualifiedName":"@proteinjs/server/healthCheck","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/Route"}],"edges":[{"v":"@proteinjs/server/NodeGlobalDataStorage","w":"@proteinjs/server-api/GlobalDataStorage","value":"implements interface"},{"v":"@proteinjs/server/NodeSessionDataStorage","w":"@proteinjs/server-api/SessionDataStorage","value":"implements interface"},{"v":"@proteinjs/server/ExtendedIncomingMessage","w":"http/IncomingMessage","value":"extends interface"},{"v":"@proteinjs/server/ExtendedSocket","w":"socket.io/Socket","value":"extends interface"},{"v":"@proteinjs/server/environmentCache","w":"@proteinjs/server-api/GlobalDataCache","value":"has type"},{"v":"@proteinjs/server/healthCheck","w":"@proteinjs/server-api/Route","value":"has type"}]}';
|
|
24
|
+
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"/() => void"},{"v":"@proteinjs/server/NodeGlobalDataStorage","value":{"packageName":"@proteinjs/server","name":"NodeGlobalDataStorage","filePath":"/home/runner/work/server/server/packages/server/src/NodeGlobalDataStorage.ts","qualifiedName":"@proteinjs/server/NodeGlobalDataStorage","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"HOOK_INITIALIZED","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"GLOBAL_DATA","type":{"packageName":"@proteinjs/server","name":"{ [id: string]: GlobalData }","filePath":null,"qualifiedName":"@proteinjs/server/{ [id: string]: GlobalData }","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"environment","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"setData","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"data","type":{"packageName":"@proteinjs/server-api","name":"GlobalData","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalData","typeParameters":null,"directParents":null}}]},{"name":"getData","returnType":{"packageName":"@proteinjs/server-api","name":"GlobalData","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalData","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"initHook","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/server-api","name":"GlobalDataStorage","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalDataStorage","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/server-api/GlobalDataStorage"},{"v":"@proteinjs/server/NodeSessionDataStorage","value":{"packageName":"@proteinjs/server","name":"NodeSessionDataStorage","filePath":"/home/runner/work/server/server/packages/server/src/NodeSessionDataStorage.ts","qualifiedName":"@proteinjs/server/NodeSessionDataStorage","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"HOOK_INITIALIZED","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"SESSION_DATA","type":{"packageName":"@proteinjs/server","name":"{ [id: string]: SessionData }","filePath":null,"qualifiedName":"@proteinjs/server/{ [id: string]: SessionData }","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"environment","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"setData","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"data","type":{"packageName":"@proteinjs/server-api","name":"SessionData","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionData","typeParameters":null,"directParents":null}}]},{"name":"getData","returnType":{"packageName":"@proteinjs/server-api","name":"SessionData","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionData","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"clearData","returnType":{"packageName":"","name":"void","filePath":null,"qualifiedName":"/void","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"initHook","returnType":null,"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/server-api","name":"SessionDataStorage","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionDataStorage","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/server-api/SessionDataStorage"},{"v":"@proteinjs/server/ExtendedIncomingMessage","value":{"packageName":"@proteinjs/server","name":"ExtendedIncomingMessage","filePath":"/home/runner/work/server/server/packages/server/src/SocketIOServerRepo.ts","qualifiedName":"@proteinjs/server/ExtendedIncomingMessage","properties":[{"name":"sessionID","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"user","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null},"isOptional":true,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParents":[{"packageName":"http","name":"IncomingMessage","filePath":null,"qualifiedName":"http/IncomingMessage","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"sourceType":3}},{"v":"http/IncomingMessage"},{"v":"@proteinjs/server/ExtendedSocket","value":{"packageName":"@proteinjs/server","name":"ExtendedSocket","filePath":"/home/runner/work/server/server/packages/server/src/SocketIOServerRepo.ts","qualifiedName":"@proteinjs/server/ExtendedSocket","properties":[{"name":"request","type":{"packageName":"@proteinjs/server","name":"ExtendedIncomingMessage","filePath":null,"qualifiedName":"@proteinjs/server/ExtendedIncomingMessage","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParents":[{"packageName":"socket.io","name":"Socket","filePath":null,"qualifiedName":"socket.io/Socket","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"sourceType":3}},{"v":"socket.io/Socket"},{"v":"@proteinjs/server/environmentCache","value":{"packageName":"@proteinjs/server","name":"environmentCache","filePath":"/home/runner/work/server/server/packages/server/src/envCache.ts","qualifiedName":"@proteinjs/server/environmentCache","type":{"packageName":"","name":"GlobalDataCache<Env>","filePath":null,"qualifiedName":"/GlobalDataCache<Env>","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"GlobalDataCache","filePath":null,"qualifiedName":"@proteinjs/server-api/GlobalDataCache","typeParameters":["@proteinjs/server-api/Env"],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/GlobalDataCache"},{"v":"@proteinjs/server/healthCheck","value":{"packageName":"@proteinjs/server","name":"healthCheck","filePath":"/home/runner/work/server/server/packages/server/src/routes/healthCheck.ts","qualifiedName":"@proteinjs/server/healthCheck","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/Route"}],"edges":[{"v":"@proteinjs/server/NodeGlobalDataStorage","w":"@proteinjs/server-api/GlobalDataStorage","value":"implements interface"},{"v":"@proteinjs/server/NodeSessionDataStorage","w":"@proteinjs/server-api/SessionDataStorage","value":"implements interface"},{"v":"@proteinjs/server/ExtendedIncomingMessage","w":"http/IncomingMessage","value":"extends interface"},{"v":"@proteinjs/server/ExtendedSocket","w":"socket.io/Socket","value":"extends interface"},{"v":"@proteinjs/server/environmentCache","w":"@proteinjs/server-api/GlobalDataCache","value":"has type"},{"v":"@proteinjs/server/healthCheck","w":"@proteinjs/server-api/Route","value":"has type"}]}';
|
|
25
25
|
|
|
26
26
|
/** Generate Source Links */
|
|
27
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteinjs/server",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "A server impl",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@proteinjs/event": "^1.0.18",
|
|
26
26
|
"@proteinjs/logger": "^1.0.21",
|
|
27
27
|
"@proteinjs/reflection": "^1.1.12",
|
|
28
|
-
"@proteinjs/server-api": "^3.
|
|
28
|
+
"@proteinjs/server-api": "^3.2.0",
|
|
29
29
|
"@proteinjs/util-node": "^1.10.1",
|
|
30
30
|
"body-parser": "1.19.0",
|
|
31
31
|
"cookie-parser": "1.4.5",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
},
|
|
65
65
|
"main": "./dist/generated/index.js",
|
|
66
66
|
"types": "./dist/generated/index.d.ts",
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "572441dede77a494f9fbfa2753896d0eccfb6d40"
|
|
68
68
|
}
|
package/src/DevClientBuild.ts
CHANGED
|
@@ -13,6 +13,12 @@ export type DevClientBuildInfo = {
|
|
|
13
13
|
builtAt: string;
|
|
14
14
|
durationMs?: number;
|
|
15
15
|
errorCount: number;
|
|
16
|
+
/**
|
|
17
|
+
* The entrypoint's script files (`app.js`, `vendor.js`, …) in the compile's own load order —
|
|
18
|
+
* the dev page's bundle tags are rendered from THIS list (reactApp.ts), so the page follows the
|
|
19
|
+
* chunk graph the webpack config declares instead of a hard-coded pair of names.
|
|
20
|
+
*/
|
|
21
|
+
assets: string[];
|
|
16
22
|
};
|
|
17
23
|
|
|
18
24
|
export class DevClientBuild {
|
package/src/GracefulShutdown.ts
CHANGED
|
@@ -3,6 +3,18 @@ import { ServerConfig } from '@proteinjs/server-api';
|
|
|
3
3
|
import { Logger } from '@proteinjs/logger';
|
|
4
4
|
import { SocketIOServerRepo } from './SocketIOServerRepo';
|
|
5
5
|
|
|
6
|
+
/** Releases a hold taken with {@link GracefulShutdown.hold}. Idempotent. */
|
|
7
|
+
export type HoldRelease = () => void;
|
|
8
|
+
|
|
9
|
+
/** A hold outstanding on the process: its label plus whatever the holder attached for the logs. */
|
|
10
|
+
export type Hold = { label: string; context?: Record<string, unknown> };
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Follows the process's holds as they come and go — the dev supervisor's lease projection
|
|
14
|
+
* (@n3xah/util-server's ServePackageHold) is the one consumer; it never decides anything here.
|
|
15
|
+
*/
|
|
16
|
+
export type HoldObserver = { acquired?: (label: string) => void; released?: (label: string) => void };
|
|
17
|
+
|
|
6
18
|
/**
|
|
7
19
|
* The one owner of the server's shutdown state. Installed by `startServer` before the listener
|
|
8
20
|
* opens; the `/health-check` route reads `isShuttingDown()` — no other flag system exists.
|
|
@@ -17,23 +29,46 @@ import { SocketIOServerRepo } from './SocketIOServerRepo';
|
|
|
17
29
|
* 2. The listener closes (socket.io clients are disconnected, and `io.close()` closes the
|
|
18
30
|
* http server it is attached to), idle keep-alive connections are closed, and in-flight
|
|
19
31
|
* requests run to completion.
|
|
20
|
-
* 3. The
|
|
21
|
-
*
|
|
32
|
+
* 3. The process WAITS for its HOLDS (`hold(label)` below) to release, bounded by
|
|
33
|
+
* `shutdown.turnDrainMs`: work that must not die with the process and that no HTTP
|
|
34
|
+
* connection represents — the canonical holder is a chat turn whose client has gone
|
|
35
|
+
* (the response detached, the model still writing, nothing persisted yet). Past the
|
|
36
|
+
* bound every hold still outstanding is logged by label and abandoned.
|
|
37
|
+
* 4. The connection drain is BOUNDED by `shutdown.drainTimeoutMs`: past it, remaining
|
|
38
|
+
* connections are force-closed. Either way the exit code is 0 — a drained shutdown is
|
|
39
|
+
* not a crash.
|
|
22
40
|
* SIGINT → exit 0 immediately (dev ctrl-C: fast and quiet; nothing needs flushing).
|
|
23
41
|
* exit 86 → NOT this class's concern: `process.exit(86)` is the ServePackageSupervisor
|
|
24
42
|
* restart-request contract (a liveness monitor giving up on a dependency); it is not
|
|
25
43
|
* signal-driven and is untouched by these handlers.
|
|
26
44
|
*
|
|
45
|
+
* Holds are a process-wide static seam so a holder never needs the server instance (a turn
|
|
46
|
+
* registry, a suite with no listener): `hold(label, context)` returns the release; the same
|
|
47
|
+
* label held twice is one hold (the release is shared — the turn registry's idempotence);
|
|
48
|
+
* `holds()` lists what is outstanding, in acquisition order; `observeHolds` lets the dev
|
|
49
|
+
* supervisor's lease follow the same set, so a holder declares itself ONCE and both the
|
|
50
|
+
* pre-signal restart deferral (dev) and the post-SIGTERM drain (prod) honor it.
|
|
51
|
+
*
|
|
52
|
+
* Why holds and not connections: the 2026-09-05 prod kill — a phone locked mid-turn, the route
|
|
53
|
+
* detached the dead response and the turn ran on to persist, GKE's autoscaler evicted the pod,
|
|
54
|
+
* and this drain saw NO connection in flight, so `process.exit(0)` ran 5 s after SIGTERM with the
|
|
55
|
+
* model call 32 s in. Nothing persisted, nothing logged (plans/FREE_AGENT.md §M.14).
|
|
56
|
+
*
|
|
27
57
|
* A SIGTERM before the listener is open (mid-boot kill) exits 0 immediately — nothing is
|
|
28
58
|
* registered anywhere and nothing is in flight.
|
|
29
59
|
*
|
|
30
60
|
* Supervisor compatibility (dev): ServePackageSupervisor SIGTERMs the child's process group and
|
|
31
61
|
* escalates to SIGKILL after its grace period (default 10s); its exit handler ignores exit codes
|
|
32
62
|
* for kills it initiated, so the drain-then-exit-0 shape cannot be misread. DEVELOPMENT defaults
|
|
33
|
-
* `drainDelayMs` to 0 so supervised restarts stay fast
|
|
63
|
+
* `drainDelayMs` to 0 so supervised restarts stay fast; a turn in flight under the supervisor is
|
|
64
|
+
* covered BEFORE the signal by its lease (the hold projection), not by this drain.
|
|
34
65
|
*/
|
|
35
66
|
export class GracefulShutdown {
|
|
36
67
|
private static instance?: GracefulShutdown;
|
|
68
|
+
private static holds = new Map<string, { hold: Hold; release: HoldRelease }>();
|
|
69
|
+
private static holdObservers = new Set<HoldObserver>();
|
|
70
|
+
private static holdWaiters: Array<() => void> = [];
|
|
71
|
+
private static staticLogger = new Logger({ name: 'GracefulShutdown' });
|
|
37
72
|
private shuttingDown = false;
|
|
38
73
|
private logger = new Logger({ name: 'GracefulShutdown' });
|
|
39
74
|
|
|
@@ -58,6 +93,48 @@ export class GracefulShutdown {
|
|
|
58
93
|
return GracefulShutdown.instance?.shuttingDown ?? false;
|
|
59
94
|
}
|
|
60
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Keep the process alive through a SIGTERM drain until the returned release is called (bounded
|
|
98
|
+
* by `shutdown.turnDrainMs`). `label` names the work in the drain's logs (`chat-turn:<id>`);
|
|
99
|
+
* `context` rides beside it (chat id, user id). Holding a label already held returns the
|
|
100
|
+
* existing release — one hold per label.
|
|
101
|
+
*/
|
|
102
|
+
static hold(label: string, context?: Record<string, unknown>): HoldRelease {
|
|
103
|
+
const existing = GracefulShutdown.holds.get(label);
|
|
104
|
+
if (existing) {
|
|
105
|
+
return existing.release;
|
|
106
|
+
}
|
|
107
|
+
const release: HoldRelease = () => {
|
|
108
|
+
if (GracefulShutdown.holds.get(label)?.release !== release) {
|
|
109
|
+
return; // already released (or the label re-held since — that hold has its own release)
|
|
110
|
+
}
|
|
111
|
+
GracefulShutdown.holds.delete(label);
|
|
112
|
+
GracefulShutdown.notify('released', label);
|
|
113
|
+
if (GracefulShutdown.holds.size === 0) {
|
|
114
|
+
const waiters = GracefulShutdown.holdWaiters.splice(0, GracefulShutdown.holdWaiters.length);
|
|
115
|
+
for (const resolve of waiters) {
|
|
116
|
+
resolve();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
GracefulShutdown.holds.set(label, { hold: context ? { label, context } : { label }, release });
|
|
121
|
+
GracefulShutdown.notify('acquired', label);
|
|
122
|
+
return release;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Every hold outstanding right now, in acquisition order. */
|
|
126
|
+
static outstandingHolds(): Hold[] {
|
|
127
|
+
return Array.from(GracefulShutdown.holds.values()).map((entry) => ({ ...entry.hold }));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Follow holds as they are acquired and released. Returns the unsubscribe. */
|
|
131
|
+
static observeHolds(observer: HoldObserver): () => void {
|
|
132
|
+
GracefulShutdown.holdObservers.add(observer);
|
|
133
|
+
return () => {
|
|
134
|
+
GracefulShutdown.holdObservers.delete(observer);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
61
138
|
private async drainAndExit(): Promise<void> {
|
|
62
139
|
if (this.shuttingDown) {
|
|
63
140
|
return; // already draining; the sender's escalation is SIGKILL, not a second drain
|
|
@@ -69,8 +146,10 @@ export class GracefulShutdown {
|
|
|
69
146
|
}
|
|
70
147
|
const drainDelayMs = this.drainDelayMs();
|
|
71
148
|
const drainTimeoutMs = this.drainTimeoutMs();
|
|
149
|
+
const turnDrainMs = this.turnDrainMs();
|
|
72
150
|
this.logger.info({
|
|
73
|
-
message: `Received SIGTERM — /health-check now reports 503; accepting connections for another ${drainDelayMs}ms, then draining in-flight requests (bound: ${drainTimeoutMs}ms)`,
|
|
151
|
+
message: `Received SIGTERM — /health-check now reports 503; accepting connections for another ${drainDelayMs}ms, then draining in-flight requests (bound: ${drainTimeoutMs}ms) and ${GracefulShutdown.holds.size} hold(s) (bound: ${turnDrainMs}ms)`,
|
|
152
|
+
obj: { holds: GracefulShutdown.outstandingHolds() },
|
|
74
153
|
});
|
|
75
154
|
// 1. Readiness-propagation window: the LB observes the 503 while we still serve normally.
|
|
76
155
|
await this.sleep(drainDelayMs);
|
|
@@ -87,7 +166,10 @@ export class GracefulShutdown {
|
|
|
87
166
|
this.server.close();
|
|
88
167
|
}
|
|
89
168
|
this.server.closeIdleConnections();
|
|
90
|
-
// 3.
|
|
169
|
+
// 3. Holds: work no connection represents (a detached chat turn). In-flight requests keep
|
|
170
|
+
// running meanwhile — the listener is closed, existing connections are not. Bounded.
|
|
171
|
+
await this.drainHolds(turnDrainMs);
|
|
172
|
+
// 4. Bounded: past the drain timeout, force-close what remains. Exit 0 either way.
|
|
91
173
|
if (!(await this.settled(drained, drainTimeoutMs))) {
|
|
92
174
|
this.logger.warn({
|
|
93
175
|
message: `Drain exceeded its ${drainTimeoutMs}ms bound — force-closing the remaining connections`,
|
|
@@ -98,6 +180,27 @@ export class GracefulShutdown {
|
|
|
98
180
|
process.exit(0);
|
|
99
181
|
}
|
|
100
182
|
|
|
183
|
+
private async drainHolds(turnDrainMs: number): Promise<void> {
|
|
184
|
+
if (GracefulShutdown.holds.size === 0) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
this.logger.info({
|
|
188
|
+
message: `Listener closed — waiting for ${GracefulShutdown.holds.size} hold(s) to release (bound: ${turnDrainMs}ms)`,
|
|
189
|
+
obj: { holds: GracefulShutdown.outstandingHolds() },
|
|
190
|
+
});
|
|
191
|
+
if (await this.settled(GracefulShutdown.whenNoHolds(), turnDrainMs)) {
|
|
192
|
+
this.logger.info({ message: `Every hold released — continuing the drain` });
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const abandoned = GracefulShutdown.outstandingHolds();
|
|
196
|
+
this.logger.warn({
|
|
197
|
+
message: `Hold drain exceeded its ${turnDrainMs}ms bound — abandoning ${abandoned.length} hold(s): ${abandoned
|
|
198
|
+
.map((hold) => hold.label)
|
|
199
|
+
.join(', ')}`,
|
|
200
|
+
obj: { holds: abandoned },
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
101
204
|
private exitNow(): void {
|
|
102
205
|
this.shuttingDown = true;
|
|
103
206
|
this.logger.info({ message: `Received SIGINT — exiting immediately` });
|
|
@@ -115,6 +218,31 @@ export class GracefulShutdown {
|
|
|
115
218
|
return this.config.shutdown?.drainTimeoutMs ?? 30_000;
|
|
116
219
|
}
|
|
117
220
|
|
|
221
|
+
private turnDrainMs(): number {
|
|
222
|
+
return this.config.shutdown?.turnDrainMs ?? 240_000;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
private static whenNoHolds(): Promise<void> {
|
|
226
|
+
if (GracefulShutdown.holds.size === 0) {
|
|
227
|
+
return Promise.resolve();
|
|
228
|
+
}
|
|
229
|
+
return new Promise<void>((resolve) => GracefulShutdown.holdWaiters.push(resolve));
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
private static notify(event: 'acquired' | 'released', label: string): void {
|
|
233
|
+
for (const observer of Array.from(GracefulShutdown.holdObservers)) {
|
|
234
|
+
try {
|
|
235
|
+
observer[event]?.(label);
|
|
236
|
+
} catch (error: any) {
|
|
237
|
+
// An observer follows the holds; its failure never touches the hold itself.
|
|
238
|
+
GracefulShutdown.staticLogger.warn({
|
|
239
|
+
message: `A hold observer threw on ${event}`,
|
|
240
|
+
obj: { label, error: error?.message },
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
118
246
|
/** Await a promise with a deadline; true if it settled in time. */
|
|
119
247
|
private async settled(promise: Promise<void>, ms: number): Promise<boolean> {
|
|
120
248
|
let timer: NodeJS.Timeout | undefined;
|