A WASM job stopped while its module is still compiling never stops issue #93 closed: completed andymccall opened this · 0 comments
andymccall set labels bug ·
closed by change 77c8c24066ef ·
andymccall set labels bug ·
closed by change 77c8c24066ef ·
A WASM job that is cancelled, or hits its time limit, while its module is still compiling never stops.
Seen 2026-10-27 00:20–00:56: the gate's
wasm::tests::in_process_stops_at_the_time_limit_and_when_cancelledspun at 99% CPU for 35 minutes, with the workstation at load 6. The same test passed earlier in the night.Cause:
run_in_threadcallsengine.increment_epoch()once when it decides to stop. The job's store is made inrun_modulesafter its module compiles, andstore.set_epoch_deadline(1)is relative to the epoch then current. When the cancel (or the deadline) comes first, the single increment happens before the store exists: its deadline lands one epoch past it, nothing increments again, and the endless loop runs on. The cancelled case starts cancelled, so its first poll at 100 ms races the compile directly. In production, that is a cancelled or timed-out WASM job a runner cannot stop.Fix: once stopped, increment the epoch on every 100 ms tick until the worker ends.