@hackerrank/astra-cli 0.1.9 → 0.1.10
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/src/verifier-runner.js +12 -0
package/package.json
CHANGED
package/src/verifier-runner.js
CHANGED
|
@@ -53,6 +53,18 @@ async function acquireVerifierLock(projectRoot, timeoutSeconds) {
|
|
|
53
53
|
};
|
|
54
54
|
} catch (error) {
|
|
55
55
|
if (error?.code !== "EEXIST") throw error;
|
|
56
|
+
// A killed benchmark worker cannot run its finally block. Reclaim only
|
|
57
|
+
// a lock whose recorded owner is no longer alive; active workers keep
|
|
58
|
+
// exclusive ownership of fixed Docker ports.
|
|
59
|
+
try {
|
|
60
|
+
const owner = Number(fs.readFileSync(lockPath, "utf8").trim());
|
|
61
|
+
process.kill(owner, 0);
|
|
62
|
+
} catch (ownerError) {
|
|
63
|
+
if (ownerError?.code === "ESRCH" || !Number.isInteger(Number(fs.readFileSync(lockPath, "utf8").trim()))) {
|
|
64
|
+
try { fs.rmSync(lockPath, { force: true }); } catch {}
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
56
68
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
57
69
|
}
|
|
58
70
|
}
|