You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <[email protected]>
0 commit comments