Commit: 2f26d91 · Finding: GEN-12
Problem
crates/client/src/lib.rs contains tokio::time::sleep(Duration::from_millis(50)).await at lines 1141, 1187, 1198, 1234, 1710, 1724, 1753, 1766, 1835, 1920 — all outside #[cfg(test)]. They appear in ordinary ClientHandle methods to "wait for actor propagation" after a do_send.
Problems:
- 50ms is too short on slow machines (races the actor), too long on fast machines (wastes latency).
- A known flakiness source for e2e suites.
- The
ask(...) pattern is available and synchronously waits for the actor reply.
Fix
Convert each do_send(...) followed by sleep(50 ms) into an ask(...).await that waits for the actor to apply the mutation. Where the mutation is truly fire-and-forget, use a watch channel or notify.
Obvious? Moderate — per-call-site decision needed but the pattern is mechanical.
Commit:
2f26d91· Finding:GEN-12Problem
crates/client/src/lib.rscontainstokio::time::sleep(Duration::from_millis(50)).awaitat lines 1141, 1187, 1198, 1234, 1710, 1724, 1753, 1766, 1835, 1920 — all outside#[cfg(test)]. They appear in ordinaryClientHandlemethods to "wait for actor propagation" after ado_send.Problems:
ask(...)pattern is available and synchronously waits for the actor reply.Fix
Convert each
do_send(...)followed bysleep(50 ms)into anask(...).awaitthat waits for the actor to apply the mutation. Where the mutation is truly fire-and-forget, use a watch channel or notify.Obvious? Moderate — per-call-site decision needed but the pattern is mechanical.