Release the mutex before calling a remote API
Keep network waits outside a shared-state lock, then check that the state is still current before applying the result. Shorter locks need a correctness policy too.
Trace shared locks, queue admission, task ownership, retained memory, and cleanup. Each guide gives a concrete reproduction, the resulting decision, and the limits of the evidence.
Keep network waits outside a shared-state lock, then check that the state is still current before applying the result. Shorter locks need a correctness policy too.
A bounded worker queue needs an admission policy. Choose between waiting, rejecting, and durable acceptance, and tell callers which promise they received.
Dropping a Tokio JoinHandle leaves its task running. Decide who owns an export after a disconnect and whether completion must survive a restart.
Buffer capacity does not limit total input. Read at most one byte beyond your accepted size, detect overflow, and apply separate time and decompression limits.
Bound fan-out before creating work. A semaphore inside thousands of spawned tasks limits active calls but leaves thousands of waiting tasks and their data.
A cheap Arc clone can retain an expensive snapshot. Follow ownership through queued tasks and distinguish inline handle size from the memory kept alive behind it.
An atomic read followed by an atomic increment is still two operations. Use a reservation protocol and define what happens when a reservation is abandoned.
Separate a worker's business error from a broken reply path. Use a typed result and observe worker lifetime instead of returning an empty success.
A handler can finish its visible work and still spend time destroying values. Trace scope exit and give expensive cleanup an explicit owner.