@feigi/fleet-ctl 3.141.4 → 3.141.5
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/package.json +1 -1
- package/scripts/suite-slot.mjs +10 -3
package/package.json
CHANGED
package/scripts/suite-slot.mjs
CHANGED
|
@@ -48,9 +48,11 @@
|
|
|
48
48
|
// Exit status: the entrypoint's own, with a child killed by signal N read as
|
|
49
49
|
// 128+N. 2 is a refusal of this script's own (usage, a malformed variable, a
|
|
50
50
|
// slot directory it cannot create); 75 is an expired wait, having launched
|
|
51
|
-
// nothing, with `suite-slot: no slot after <n>s` on stderr.
|
|
52
|
-
// prints `
|
|
53
|
-
//
|
|
51
|
+
// nothing, with `suite-slot: no slot after <n>s` on stderr. A full run that
|
|
52
|
+
// finds every slot held prints `suite-slot: waiting up to <n>s for a slot` to
|
|
53
|
+
// stderr once, before it first sleeps; a cap of 0 never sleeps and prints none.
|
|
54
|
+
// On acquisition it prints `SUITE_SLOT_WAIT_MS=<n>` to stderr — the
|
|
55
|
+
// milliseconds the wait took, a few at most when a slot was free.
|
|
54
56
|
//
|
|
55
57
|
// A waiter cycles the slots every 2 s. While the entrypoint runs, SIGTERM,
|
|
56
58
|
// SIGINT and SIGHUP are forwarded to it and the wrapper exits when it does.
|
|
@@ -165,6 +167,7 @@ function wedges(held) {
|
|
|
165
167
|
const started = Date.now();
|
|
166
168
|
const held = [];
|
|
167
169
|
let slotPath = pass(held);
|
|
170
|
+
let announced = false;
|
|
168
171
|
while (slotPath === null) {
|
|
169
172
|
const left = waitMs - (Date.now() - started);
|
|
170
173
|
if (left <= 0) {
|
|
@@ -172,6 +175,10 @@ while (slotPath === null) {
|
|
|
172
175
|
writeAll(2, `${NAME}: no slot after ${waitMs / 1000}s${detail}\n`);
|
|
173
176
|
process.exit(EXIT_NO_SLOT);
|
|
174
177
|
}
|
|
178
|
+
if (!announced) {
|
|
179
|
+
writeAll(2, `${NAME}: waiting up to ${waitMs / 1000}s for a slot\n`);
|
|
180
|
+
announced = true;
|
|
181
|
+
}
|
|
175
182
|
await new Promise((r) => setTimeout(r, Math.min(CYCLE_MS, left)));
|
|
176
183
|
slotPath = pass(held);
|
|
177
184
|
}
|