Skip to content

Commit

Permalink
fix(worker): Log data-dropping events with error (#1032)
Browse files Browse the repository at this point in the history
Co-authored-by: sentry-bot <[email protected]>
  • Loading branch information
untitaker and sentry-bot authored Mar 3, 2021
1 parent b9cdcd6 commit 68fb0b4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sentry_sdk/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,14 @@ def _wait_flush(self, timeout, callback):
# type: (float, Optional[Any]) -> None
initial_timeout = min(0.1, timeout)
if not self._timed_queue_join(initial_timeout):
pending = self._queue.qsize()
pending = self._queue.qsize() + 1
logger.debug("%d event(s) pending on flush", pending)
if callback is not None:
callback(pending, timeout)
self._timed_queue_join(timeout - initial_timeout)

if not self._timed_queue_join(timeout - initial_timeout):
pending = self._queue.qsize() + 1
logger.error("flush timed out, dropped %s events", pending)

def submit(self, callback):
# type: (Callable[[], None]) -> None
Expand All @@ -115,7 +118,7 @@ def submit(self, callback):

def on_full_queue(self, callback):
# type: (Optional[Any]) -> None
logger.debug("background worker queue full, dropping event")
logger.error("background worker queue full, dropping event")

def _target(self):
# type: () -> None
Expand Down

0 comments on commit 68fb0b4

Please sign in to comment.