perf(scripting): cut out-of-process runner host CPU; compile timeout from compile start; quiet start-failure logs (lmxopcua#789, #790, #788)
v2-ci / unit-tests (push) Has been cancelled
v2-ci / unit-tests (push) Has been cancelled
#789 (partial, further tuning deferred): combining inline frame writer, buffered frame reader, one timer per evaluation for T and T+G, slot release on the reader before the caller resumes, a non-spinning per-connection result dispatcher, and blocking pipe I/O on Unix (both ends) so the socket never enters the socket engine; TerminateJobObject kill on Windows. macOS host CPU at 10k evals/s K=2: 228-240 % -> 79 % (InProcess 69 %, IPC share +10 vs budget 25); windev 153 % -> 123 % (+115, still a miss). Harness reports the "vs InProcess" share, warm-cache worker RSS, and times kill latency from the soft-timeout answer. #790: the worker sends LoadStarted; the compile timeout is armed then, so a load queued behind other compiles is never killed or struck. #788: one Error with stack per down period, rate-limited Warnings with attempt count, one Information on recovery. Design doc §8.2 notes + §12.2 record. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -59,6 +59,14 @@ internal sealed class WindowsJobObject : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Kills every process in the job at once (lmxopcua#789). The job admits exactly one process, so this is the
|
||||
/// worker's whole tree without <c>Process.Kill(entireProcessTree: true)</c>'s system-wide process snapshot,
|
||||
/// which cost about 100–200 ms of the Windows kill latency.
|
||||
/// </summary>
|
||||
/// <returns>False when the job could not be terminated (the caller falls back to a process kill).</returns>
|
||||
public bool Terminate() => !_handle.IsClosed && TerminateJobObject(_handle, unchecked((uint)-1));
|
||||
|
||||
/// <summary>Closes the job handle, which kills every process still in it.</summary>
|
||||
public void Dispose() => _handle.Dispose();
|
||||
|
||||
@@ -98,7 +106,7 @@ internal sealed class WindowsJobObject : IDisposable
|
||||
public UIntPtr PeakJobMemoryUsed;
|
||||
}
|
||||
|
||||
#pragma warning disable SYSLIB1054 // DllImport kept: LibraryImport would need AllowUnsafeBlocks for three calls.
|
||||
#pragma warning disable SYSLIB1054 // DllImport kept: LibraryImport would need AllowUnsafeBlocks for four calls.
|
||||
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
private static extern SafeFileHandle CreateJobObjectW(IntPtr securityAttributes, string? name);
|
||||
|
||||
@@ -110,5 +118,9 @@ internal sealed class WindowsJobObject : IDisposable
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool AssignProcessToJobObject(SafeFileHandle job, IntPtr process);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
private static extern bool TerminateJobObject(SafeFileHandle job, uint exitCode);
|
||||
#pragma warning restore SYSLIB1054
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user