@quolu/lattice 0.114.3 → 0.114.4
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quolu/lattice",
|
|
3
|
-
"version": "0.114.
|
|
3
|
+
"version": "0.114.4",
|
|
4
4
|
"description": "Schedulability compiler for multi-agent development: observe real code boundaries, refactor the conflicting seam, recompile the plan for parallel execution",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Quo / クオ at kitepon.dev",
|
|
@@ -53,7 +53,8 @@ export async function prepareLifecycleDirectory(root) {
|
|
|
53
53
|
if (!match) continue;
|
|
54
54
|
let alive = true;
|
|
55
55
|
try { process.kill(Number(match[1]), 0); } catch (error) {
|
|
56
|
-
|
|
56
|
+
// EPERM: the writer pid now belongs to another user, so our writer is gone.
|
|
57
|
+
if (error.code !== 'ESRCH' && error.code !== 'EPERM') throw error;
|
|
57
58
|
alive = false;
|
|
58
59
|
}
|
|
59
60
|
if (!alive) {
|
|
@@ -5,11 +5,14 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
|
|
6
6
|
const execute = promisify(execFile);
|
|
7
7
|
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* A missing process and an unavailable birth observation are different. EPERM on the kill-zero probe means the pid
|
|
10
|
+
* now belongs to another user; our dashboard processes run as us, so that pid is not ours = missing (BugHub 92b367ad).
|
|
11
|
+
*/
|
|
9
12
|
export async function observeDashboardProcess(pid) {
|
|
10
13
|
if (!Number.isSafeInteger(pid) || pid < 1) throw new TypeError('invalid dashboard pid');
|
|
11
14
|
try { process.kill(pid, 0); } catch (error) {
|
|
12
|
-
if (error.code === 'ESRCH') return null;
|
|
15
|
+
if (error.code === 'ESRCH' || error.code === 'EPERM') return null;
|
|
13
16
|
throw error;
|
|
14
17
|
}
|
|
15
18
|
try {
|
|
@@ -30,7 +33,7 @@ export async function observeDashboardProcess(pid) {
|
|
|
30
33
|
} catch (error) {
|
|
31
34
|
// Recheck death after a racing exit. An observation failure never licenses a kill.
|
|
32
35
|
try { process.kill(pid, 0); } catch (probeError) {
|
|
33
|
-
if (probeError.code === 'ESRCH') return null;
|
|
36
|
+
if (probeError.code === 'ESRCH' || probeError.code === 'EPERM') return null;
|
|
34
37
|
throw probeError;
|
|
35
38
|
}
|
|
36
39
|
return { pid, birth: null, observation: 'unavailable' };
|
|
@@ -352,7 +352,8 @@ async function daemonHealthy(descriptor) {
|
|
|
352
352
|
|
|
353
353
|
function processIsAlive(pid) {
|
|
354
354
|
try { process.kill(pid, 0); return true; } catch (error) {
|
|
355
|
-
|
|
355
|
+
// EPERM: the pid belongs to another user, so it is not our daemon.
|
|
356
|
+
if (error?.code === 'ESRCH' || error?.code === 'EPERM') return false;
|
|
356
357
|
throw error;
|
|
357
358
|
}
|
|
358
359
|
}
|