fix(javascript): transient Windows private-runtime source-transfer (#8769)

* fix(javascript): transient Windows private-runtime source-transfer

Parent source-transfer into the Windows private runtime root failed with
EPERM on path-based exclusive create. Write through a native transient
private-runtime path that closes the handle after flush so per-job rm
still works, and yield around the sync write so abort deadlines can fire.

* fix(javascript): yield timer phase before Windows source-transfer write
This commit is contained in:
Beqa authored and GitHub committed 2026-11-05 18:32:43 +08:00
1 parent 7b6fc6f13d
commit 4362a0848e
6 files changed
+281 -8

No files matched your search

@@ -7,8 +7,9 @@ import type {
JavaScriptSemanticFileProjection,
} from "../../domain/javascript/javascriptSemanticFileProjection.js";
import { createHash, randomUUID } from "node:crypto";
import { readFile, rm, stat, writeFile } from "node:fs/promises";
import { readFile, rm, stat } from "node:fs/promises";
import { join } from "node:path";
import { writeJavaScriptAnalysisSourceTransfer } from "./JavaScriptAnalysisSourceTransfer.js";
import { StringDecoder } from "node:string_decoder";
import { fileURLToPath } from "node:url";
import { getHeapStatistics } from "node:v8";
@@ -333,11 +334,11 @@ export class JavaScriptAnalysisWorker {
);
supervisor.resetOutput();
this.#phase = "source-transfer";
await writeFile(join(rootPath, `${id}.source`), file.text.value, {
flag: "wx",
mode: 0o600,
signal: deadline.signal,
});
await writeJavaScriptAnalysisSourceTransfer(
join(rootPath, `${id}.source`),
file.text.value,
{ signal: deadline.signal },
);
const { text: _text, ...metadata } = file;
let offeredResultBudget = 0;
const request = javaScriptWorkerRequestSchema.parse({