Keep demand compilation responsive

This commit is contained in:
udo
2026-07-18 11:14:40 +00:00
parent 495a8ae5f0
commit 0e0c0b6ccc
2 changed files with 104 additions and 49 deletions
+8 -1
View File
@@ -233,7 +233,14 @@ whose compilation outlasted the guest CPU budget would immediately trap in the
following allocator/relocation call even though no guest loop consumed it.
The proactive compiler and request workers coordinate through per-unit file
locks and a lock-protected demand-priority queue under `BIN_DIRECTORY`. Unit
locks and a lock-protected demand-priority queue under `BIN_DIRECTORY`. A small
priority-only compiler process drains that queue independently of the full-site
scanner. This matters when the scanner is already inside a long transitive C++
compile: a requested stale component can rebuild immediately instead of waiting
for that unrelated compile to finish. Both compiler processes use the same
per-unit lock, so concurrent demand and scan discovery cannot publish duplicate
artifacts. The priority worker is idle when there is no demand and never scans
the site on its own. Unit
compilation writes and validates a process-unique temporary wasm file, then
publishes it with an atomic rename. When proactive compilation is enabled,
read-only HTTP requests keep using the last complete artifact while requesting