feat(supabase): verification retry by effective cause

resource_limit (intrinsic to the frozen input: frame, input or output cap,
SIGXCPU, SIGABRT, SIGSYS) and verdict_refused close the round at the first
occurrence; timeout, unavailable (now also an external SIGKILL) and
lease_expired keep the 2/5/10/20 s retries up to five attempts. pgTAP 021: 89;
sandbox case k closes at attempt 1.
This commit is contained in:
bchanot committed 2026-11-01 23:01:30 +01:00
1 parent c98a9c8f82
commit a5844b9d56
8 files changed
+156 -46

No files matched your search

+12 -1
View File
@@ -246,6 +246,17 @@ enum ChildVerdict {
Stop,
}
/// The child's own budgets end it with SIGXCPU (CPU, the hard limit sits two seconds
/// after the soft one), SIGABRT (memory) or SIGSYS (seccomp): the same input ends the
/// same way, so `resource_limit` (definitive). Any other signal, SIGKILL first, came
/// from outside (OOM killer, stop): transient `unavailable`.
fn signal_code(signal: i32) -> &'static str {
match signal {
libc::SIGXCPU | libc::SIGABRT | libc::SIGSYS => codes::RESOURCE_LIMIT,
_ => codes::UNAVAILABLE,
}
}
/// Maps every way the child can end to a verdict on the round (§6.5 rows).
fn classify_child(run: ChildRun, job: &VerifyJob) -> ChildVerdict {
let stderr = run.stderr;
@@ -262,7 +273,7 @@ fn classify_child(run: ChildRun, job: &VerifyJob) -> ChildVerdict {
.signal(signal)
.child_stderr(&stderr)
.emit();
ChildVerdict::Report(codes::RESOURCE_LIMIT)
ChildVerdict::Report(signal_code(signal))
}
ChildOutcome::OutputOverflow => {
log::warn("child_output_overflow").review(review).emit();