Skip a job-scheduling tick on transiently stale clock instead of ending the agent session
Rust development slice / linux (push) Failing after 6s

This commit is contained in:
2026-11-17 13:12:37 +01:00
parent 90689dafd1
commit af9e9ec479
+2 -2
View File
@@ -2238,8 +2238,8 @@ impl Agent {
if self.start_sync(&channel,generation).await.is_err(){self.close_gate();needs_sync=true;}else{needs_sync=false;}sync_at=Instant::now();
}
if !needs_sync && !self.prepared && self.ready(generation) && jobs::events(self.journal.connection())?.is_empty() && self.journal.count()?==0 {
let now=self.clock.now()?;
if let Some(offer)=jobs::next_at(self.journal.connection(),now)? {
// A transiently stale clock skips this tick; it must not end the session.
if let Ok(now)=self.clock.now() && let Some(offer)=jobs::next_at(self.journal.connection(),now)? {
let job=self.binding.as_ref().context("JOB_BINDING_REQUIRED")?.job(&offer.payload_bytes)?;
ensure!(self.scope_permits(&offer,&job),"WINDOWS_ECHO_OFFER_OUT_OF_SCOPE");
if now>=job.start_before {self.record(generation,&offer,"",jobs::no_start("expired","START_DEADLINE_EXPIRED"))?;needs_sync=true;}