neurastream 0.2.79 → 0.2.80
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/adapters/omp/index.ts +10 -5
package/package.json
CHANGED
|
@@ -633,7 +633,9 @@ export function deliverOwnerInbox(pi: ExtensionHost, cfg: Config): void {
|
|
|
633
633
|
let activeAdapterReset: (() => void) | null = null;
|
|
634
634
|
/** This process's held Main session lock (plan 20261103_1146 P2): the first main session_start
|
|
635
635
|
* locks `<queue_state>/mains/<id>/session.lock` for the process lifetime — the kernel frees it
|
|
636
|
-
* when the process dies
|
|
636
|
+
* when the process dies. A factory re-run must not release it (P4): dropping it lets another
|
|
637
|
+
* process take the id, and a new flock of the same file in this process is busy. reset() is the
|
|
638
|
+
* only release, so tests do not leak the flock into the next file. */
|
|
637
639
|
let heldSessionLock: HeldLock | null = null;
|
|
638
640
|
/** The limit tick: one check of the open episode every 30 s (plan 20261027_1500 P3). */
|
|
639
641
|
const LIMIT_TICK_MS = 30_000;
|
|
@@ -1418,12 +1420,12 @@ export function createOmpAdapter(pi: ExtensionHost, initial: Config, freshConfig
|
|
|
1418
1420
|
flight = null;
|
|
1419
1421
|
};
|
|
1420
1422
|
// Clear the previous adapter's armed grace timer before this one overwrites the pointer (P3c).
|
|
1423
|
+
// Do not release heldSessionLock: this runs on every factory re-entry, and the lock is
|
|
1424
|
+
// process-lifetime (plan 20261103_1146 P4). reset() still releases it.
|
|
1421
1425
|
activeAdapterReset?.();
|
|
1422
1426
|
activeAdapterReset = (): void => {
|
|
1423
1427
|
clearRolloverState();
|
|
1424
1428
|
stopLimitTick();
|
|
1425
|
-
heldSessionLock?.release();
|
|
1426
|
-
heldSessionLock = null;
|
|
1427
1429
|
};
|
|
1428
1430
|
// The launcher restarts omp: the request file carries the note and the editor draft, and omp
|
|
1429
1431
|
// shuts down only after the file is written. A failed write keeps the session running.
|
|
@@ -1810,13 +1812,16 @@ export function createOmpAdapter(pi: ExtensionHost, initial: Config, freshConfig
|
|
|
1810
1812
|
});
|
|
1811
1813
|
}
|
|
1812
1814
|
|
|
1813
|
-
/** Clear the active adapter's rollover state. Tests call this in
|
|
1814
|
-
* grace-period timer does not fire into a later test file's sandbox paths
|
|
1815
|
+
/** Clear the active adapter's rollover state and release the session lock. Tests call this in
|
|
1816
|
+
* afterAll so a stale grace-period timer does not fire into a later test file's sandbox paths
|
|
1817
|
+
* (P3c), and so the process-lifetime flock does not leak into the next file (P4). */
|
|
1815
1818
|
export function reset(): void {
|
|
1816
1819
|
if (activeAdapterReset) {
|
|
1817
1820
|
activeAdapterReset();
|
|
1818
1821
|
activeAdapterReset = null;
|
|
1819
1822
|
}
|
|
1823
|
+
heldSessionLock?.release();
|
|
1824
|
+
heldSessionLock = null;
|
|
1820
1825
|
}
|
|
1821
1826
|
|
|
1822
1827
|
/** package.json omp.extensions entry. */
|