10000 fix(worker): Log data-dropping events with error by untitaker · Pull Request #1032 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content

fix(worker): Log data-dropping events with error #1032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions sentry_sdk/worker.py
7EA2
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