Skip to content
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

Log dropping and block windows #12342

Closed
wants to merge 1 commit into from
Closed

Conversation

amirylm
Copy link
Collaborator

@amirylm amirylm commented Mar 7, 2024

AUTO-8985

Motivation

As part of rate limiting, we might need to drop logs. The dropping should be consistent across nodes, using a function that can be shared

Changes

  • added function to get the block range / window of a given block and rate
  • added comparator and sorter functions for ordering

Copy link
Contributor

github-actions bot commented Mar 7, 2024

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

@amirylm amirylm requested review from ferglor and infiloop2 March 7, 2024 17:31
func BlockWindow(block int64, blockRate int) (start int64, end int64) {
windowSize := int64(blockRate)
if windowSize == 0 {
return block, block
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we return an error here/enforce non-zero windows?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd rather validate it somewhere else but still prefer to check for zero here to avoid doing mod with 0

@cl-sonarqube-production
Copy link

@amirylm amirylm marked this pull request as ready for review March 8, 2024 15:32
@amirylm amirylm requested a review from a team as a code owner March 8, 2024 15:32
@amirylm
Copy link
Collaborator Author

amirylm commented Apr 3, 2024

Will be merged with #12357

@amirylm amirylm closed this Apr 3, 2024
@amirylm amirylm mentioned this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants