Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
appender: fix races in tracing-appender unit tests (tokio-rs#737)
## Motivation I was able to reproduce the failures for `logs_dropped_if_lossy` on my machine when using loom. Realized that the Worker calls `recv` and the only time we actually will increment the error_counter is when we have a write blocking on the call to `write_all` (called by the worker) and a messege buffered in NonBlocking crossbeam sender. ## Solution I added some sleeps after writes to avoid some races I saw. For `multi_threaded_writes`, what likely is happening is that sometimes the last thread hasn't had a chance write to the queue, hence we now use `recv_timeout` instead of `try_recv`, to ensure there's more than enough time for the message to be visible in the channel. Co-authored-by: Zeki Sherif <zekshi@amazon.com>
- Loading branch information