element-hq / element-hq/synapse
Sentry noise: `Sentry is attempting to send N pending error messages`
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#14069](https://github.com/matrix-org/synapse/issues/14069).
---
E.g. https://sentry.tools.element.io/organizations/element/issues/608
```
2022-09-28 10:27:50,446 - twisted - 274 - INFO - sentinel - Main loop terminated.
2022-09-28 10:27:50,549 - twisted - 274 - ERROR - sentinel - Sentry is attempting to send 94 pending error messages
2022-09-28 10:27:50,555 - twisted - 274 - ERROR - sentinel - Waiting up to 2 seconds
2022-09-28 10:27:50,563 - twisted - 274 - ERROR - sentinel - Press Ctrl-C to quit
```
Presumably comes from https://github.com/getsentry/sentry-python/blob/4c09f3203d6d19789c6fa729a2e46557ad4ea913/sentry_sdk/integrations/atexit.py#L30-L33
Given that we redirect stderr -> twisted -> stdlib logging (for Reasons :TM:) this ends up as an ERROR; I think a warning makes more sense. There are some notes [here](https://docs.sentry.io/platforms/python/guides/flask/configuration/integrations/default-integrations/#atexit).
Contributor guide
Research direction
Start with the referenced sentry-python sentry_sdk/integrations/atexit.py lines and trace how Synapse redirects stderr through Twisted to standard logging. Confirm where the pending-message output is assigned ERROR, then identify whether the change belongs in Synapse or the Sentry integration. Done means this message is emitted as a warning rather than an ERROR.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100