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:
1 parent
c98a9c8f82
commit
a5844b9d56
8 files changed
+156
-46
No files matched your search
@@ -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();
|
||||
|
||||
@@ -365,7 +365,7 @@ fn tracked_an_object_over_the_policy_is_reported_drawing_missing() {
|
||||
|
||||
// Tracked misclassification (owner brief 2026-11-01), not fixed: a document naming enough
|
||||
// drawings that the frame header passes 64 KiB is refused by the parent's own framing and
|
||||
// reported `resource_limit` (a worker failure, retried) where `caps` would name it.
|
||||
// reported `resource_limit` (a definitive worker failure) where `caps` would name it.
|
||||
#[test]
|
||||
fn tracked_a_header_over_64_kib_is_reported_resource_limit() {
|
||||
let rows = vec![row(); 600];
|
||||
@@ -378,6 +378,7 @@ fn tracked_a_header_over_64_kib_is_reported_resource_limit() {
|
||||
fake.calls().last().unwrap(),
|
||||
&fail_call(codes::RESOURCE_LIMIT)
|
||||
);
|
||||
assert_eq!(fake.names().iter().filter(|n| *n == "fail").count(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -435,7 +436,8 @@ fn every_child_limit_maps_to_its_closed_code() {
|
||||
ChildOutcome::Signalled { signal: 24 },
|
||||
codes::RESOURCE_LIMIT,
|
||||
),
|
||||
(ChildOutcome::Signalled { signal: 9 }, codes::RESOURCE_LIMIT),
|
||||
(ChildOutcome::Signalled { signal: 9 }, codes::UNAVAILABLE),
|
||||
(ChildOutcome::Signalled { signal: 15 }, codes::UNAVAILABLE),
|
||||
(ChildOutcome::Signalled { signal: 6 }, codes::RESOURCE_LIMIT),
|
||||
(
|
||||
ChildOutcome::Signalled { signal: 31 },
|
||||
|
||||
Reference in new issue
Block a user