Skip to content
New issue

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

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

Already on GitHub? # to your account

ref(server): Apply rate limits per item in fast-path #618

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

jan-auer
Copy link
Member

@jan-auer jan-auer commented Jun 8, 2020

Note: This is based on #616 and #617. Only look at the last commit.

Introduces EnvelopeLimiter, a utility that applies rate limits to envelope items. It implements logic around a check function that can either be used to check cached rate limits or Redis. The check function is called with the following rules:

  • Once for a single event, if present in the envelope.
  • Once for all attachments comprised, unless the event was rate limited.
  • Once for all sessions comprised.

Items violating the rate limit are removed from the envelope. This follows a set of rules:

  • If the event is removed, all items depending on the event are removed (e.g. attachments).
  • Attachments are not removed if they create events (e.g. minidumps).
  • Sessions are handled separate to all of the above.

This is only used in the fast-path and will be added to normalization in a follow-up PR.

Changelog (Features): Apply cached rate limits to attachments and sessions in the fast-path when parsing incoming requests. (#618)

@jan-auer jan-auer requested a review from a team June 8, 2020 16:06
@jan-auer jan-auer self-assigned this Jun 8, 2020
Copy link
Member

@untitaker untitaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diff looks fine. I will have to relearn rate limits and quotas sometime soon but the changes here make sense to me

@jan-auer jan-auer merged commit 7272573 into master Jun 9, 2020
@jan-auer jan-auer deleted the wip/item-fast-path branch June 9, 2020 11:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants