Skip to content

Commit 2be5500

Browse files
committed
Fix race condition in AsyncWorker shutdown
1 parent e31d845 commit 2be5500

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ddtrace/writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def _target(self):
147147
except Exception as err:
148148
log.error("cannot send services: {0}".format(err))
149149

150-
elif self._trace_queue.closed():
150+
if self._trace_queue.closed() and self._trace_queue.size() == 0:
151151
# no traces and the queue is closed. our work is done
152152
return
153153

0 commit comments

Comments
 (0)