Skip to content

Commit

Permalink
drop writer before joining worker thread
Browse files Browse the repository at this point in the history
  • Loading branch information
trtt committed Nov 13, 2021
1 parent 13fec12 commit 45da512
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tracing-appender/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ impl<T: Write + Send + Sync + 'static> Worker<T> {
match self.work() {
Ok(WorkerState::Continue) | Ok(WorkerState::Empty) => {}
Ok(WorkerState::Shutdown) | Ok(WorkerState::Disconnected) => {
drop(self.writer); // drop now in case it blocks
let _ = self.shutdown.recv();
return;
}
Expand Down

0 comments on commit 45da512

Please sign in to comment.