-
Notifications
You must be signed in to change notification settings - Fork 0
feat: capacity governor / backoff for work autonomous job runner
#417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
be7a30e
873eff7
c16b4e8
720faa0
170c134
0af37e2
6667f8c
c453dc8
0b00e45
76308f8
1a20e46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -375,7 +375,11 @@ pub fn run_headless( | |
| diagnostic_suffix(&c) | ||
| )) | ||
| } | ||
| Ok(_) => HeadlessOutcome::Failed(format!("{} exited non-zero", spec.display_name)), | ||
| Ok(c) => HeadlessOutcome::Failed(format!( | ||
| "{} exited non-zero{}", | ||
| spec.display_name, | ||
| diagnostic_suffix(&c) | ||
| )), | ||
|
Comment on lines
+378
to
+382
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Preserve stderr when stdout is also present.
Also applies to: 870-889 🤖 Prompt for AI Agents |
||
| Err(e) => HeadlessOutcome::Failed(format!("failed to run {}: {e}", spec.display_name)), | ||
| } | ||
| } | ||
|
|
@@ -862,4 +866,25 @@ mod tests { | |
| assert!(suffix.contains("last stderr before kill")); | ||
| assert!(suffix.contains("panic: something broke")); | ||
| } | ||
|
|
||
| #[test] | ||
| fn failed_non_zero_exit_includes_captured_output() { | ||
| let captured = Captured { | ||
| stdout: String::new(), | ||
| stderr: "HTTP 429 Too Many Requests".to_string(), | ||
| success: false, | ||
| timed_out: false, | ||
| idle_killed: false, | ||
| }; | ||
| let msg = match Ok::<_, std::io::Error>(captured) { | ||
| Ok(c) if c.success => unreachable!(), | ||
| Ok(c) if c.timed_out => unreachable!(), | ||
| Ok(c) => format!("test exited non-zero{}", diagnostic_suffix(&c)), | ||
| Err(_) => unreachable!(), | ||
| }; | ||
| assert!( | ||
| msg.contains("HTTP 429 Too Many Requests"), | ||
| "expected captured stderr in the failure message, got: {msg}" | ||
| ); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Prevent an oversized retry delay from becoming an immediate retry.
Line 213 casts
u64toi64without validation. A delay abovei64::MAXbecomes negative. The queued job then satisfiesnot_before <= nowand retries immediately. Use checked conversion and saturating timestamp arithmetic. Add a regression test withSome(u64::MAX).Proposed fix
🤖 Prompt for AI Agents