Skip to content

Commit e9d9c68

Browse files
committed
Drop events when rate limiter fails
1 parent 5ea52c3 commit e9d9c68

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sentry/web/api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,11 @@ def process(self, request, project, auth, helper, data, **kwargs):
299299
if isinstance(rate_limit, bool):
300300
rate_limit = RateLimit(is_limited=rate_limit, retry_after=None)
301301

302-
if rate_limit is not None and rate_limit.is_limited:
302+
# XXX(dcramer): when the rate limiter fails we drop events to ensure
303+
# it cannot cascade
304+
if rate_limit is None or rate_limit.is_limited:
305+
if rate_limit is None:
306+
helper.log.debug('Dropped event due to error with rate limiter')
303307
app.tsdb.incr_multi([
304308
(app.tsdb.models.project_total_received, project.id),
305309
(app.tsdb.models.project_total_rejected, project.id),

0 commit comments

Comments
 (0)