Skip to content

[GEN-12] tokio::time::sleep(50ms) used to "wait for actor propagation" in ~10 ClientHandle methods #271

@intendednull

Description

@intendednull

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions