docs(scripting): T starts at the run's start but is wall clock from there; document the late-notice, ceiling and counter rules (#827 review F4)
The proto comment, VirtualTags.md and CLAUDE.md said the soft deadline measures the script's own execution and that starvation never counts. Only the time before the run STARTS is excluded; from the start it is wall-clock time, as in process, so a GC pause or a starved / suspended worker during the run still counts. A mid-run freeze test is not added: it races the script's own return against the watchdog's notice; documented as not covered. Also documents F2 (late notice cancels and counts), F3 (progress ceiling, killed_unresponsive) and F5 (answer = stalled | retrigger).
This commit is contained in:
@@ -147,14 +147,17 @@ message EvalResult {
|
||||
// just finished. So a run waiting behind a sibling is never timed out, struck or killed for the sibling's time.
|
||||
// Either list may be the only content of a frame. A host that predates these fields ignores them.
|
||||
//
|
||||
// Worker soft clock (lmxopcua#827, negotiated by Hello/Ready.worker_soft_clock): the soft deadline T measures the
|
||||
// script's OWN execution — the worker starts it when an evaluation thread starts the run and reports the crossing in
|
||||
// `soft_expired_eval_ids` (it does not cancel the run itself: the host answers its caller first, then sends Cancel,
|
||||
// keeping the in-process ordering). The host arms the hard deadline G from that notice. What the host keeps on its own
|
||||
// clock is a TRANSPORT deadline, T + G from submit (restarted at a deferred run's start): no result and no soft notice
|
||||
// by then means the pipe or the worker process is late — the caller is answered as a runner fault ("script worker
|
||||
// unresponsive", BadResourceUnavailable), never as a script timeout, and nothing is struck. A starved or stalled worker
|
||||
// therefore cannot make a trivial script look over budget; a hung one is still caught by the heartbeat silence kill.
|
||||
// Worker soft clock (lmxopcua#827, negotiated by Hello/Ready.worker_soft_clock): the soft deadline T starts when an
|
||||
// evaluation thread starts the run (not at submit) and is wall-clock time from there, as in process — a pause or
|
||||
// starvation DURING the run still counts. The worker reports the crossing in `soft_expired_eval_ids` (it does not
|
||||
// cancel the run itself: the host answers its caller first, then sends Cancel, keeping the in-process ordering). The
|
||||
// host arms the hard deadline G from that notice. What the host keeps on its own clock is a TRANSPORT deadline, T + G
|
||||
// from submit (restarted at a deferred run's start): no result and no soft notice by then means the pipe or the worker
|
||||
// process is late — the caller is answered as a runner fault ("script worker unresponsive", BadResourceUnavailable),
|
||||
// not as a script timeout, and nothing is struck (a soft notice that arrives later still cancels the run and counts as
|
||||
// a timeout). A worker that starts runs late therefore cannot make a trivial script look over budget; one that stops
|
||||
// heartbeating is killed for silence, and one that heartbeats without progress is killed at the host's progress
|
||||
// ceiling.
|
||||
message EvalResults {
|
||||
repeated EvalResult items = 1;
|
||||
repeated uint64 started_eval_ids = 2;
|
||||
|
||||
Reference in New Issue
Block a user