Watch
1
0
Fork
You've already forked souveraine
0

flush the pending queue before returning

tokio's File buffers; an append that returned Ok could still be in memory
when the next take() read the file. Caught by multiple_appends_accumulate on
a runner, never on a developer machine.
This commit is contained in:
Fimeg 2026-08-23 21:20:17 -04:00
commit 219590a89c

View file

@ -66,6 +66,11 @@ pub async fn append(agent_data_dir: &Path, items: &[PendingSurfacing]) -> anyhow
buf.push('\n'); buf.push('\n');
} }
file.write_all(buf.as_bytes()).await?; file.write_all(buf.as_bytes()).await?;
// tokio's File buffers. Without this the bytes can still be in memory when
// the next take() reads the file, and an append that returned Ok is simply
// absent -- which is what multiple_appends_accumulate caught on a runner
// and never caught on a developer machine.
file.flush().await?;
Ok(()) Ok(())
} }