fix: retain complete histories with bounded journal capacity and native recovery
Rust development slice / linux (push) Failing after 6s

This commit is contained in:
2026-11-13 19:11:45 +01:00
parent da7eb8109c
commit c512bd6fb2
36 changed files with 2556 additions and 38 deletions
+24
View File
@@ -209,6 +209,29 @@ impl<C: reconcile::SyncClock> Agent<C> {
tx.commit()?;
Ok(())
}
/// New process only. Persist honest uncertainty before any helper snapshot
/// can block; the ordinary first-channel replay publishes it before Sync.
fn recover_interrupted(&mut self) -> Result<()> {
let Some(binding) = &self.binding else {
return Ok(());
};
let interrupted = jobs::interrupted(&self.db, &self.ledger, binding)?;
for (offer, grant) in interrupted {
if grant.is_empty() {
jobs::interrupted_request(&self.db, &offer)?;
} else {
self.record(
0,
&offer,
&grant,
rmm_privileged_helper::Outcome::unknown("AGENT_PROCESS_INTERRUPTED"),
)?;
}
}
// No finish/unlock here. Only normal bound reconciliation can release
// a consumed attempt once independent definitive evidence is available.
Ok(())
}
async fn replay(&mut self, ws: &wire_channel::Handle, generation: u64) -> Result<()> {
// A large replay backlog must not monopolize heartbeat/cancel handling.
// On backpressure timeout, discard this channel rather than continuing
@@ -789,6 +812,7 @@ async fn main() -> Result<()> {
certificates,
rotation_policy,
};
agent.recover_interrupted()?;
let mut backoff = 1_u64;
loop {
let started = Instant::now();