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

Polish Thanos Receive load shedding #118

Merged
merged 1 commit into from
Dec 20, 2024
Merged

Polish Thanos Receive load shedding #118

merged 1 commit into from
Dec 20, 2024

Conversation

hczhu-db
Copy link
Collaborator

@hczhu-db hczhu-db commented Dec 19, 2024

Will add unit tests in a follow-up PR

  1. Better instrumentation
  2. Better error message
rpc error: code = ResourceExhausted desc = too many pending series requests: 1000 >= 1000"
image

@hczhu-db hczhu-db force-pushed the fix-load-shedding branch 2 times, most recently from 3a542ba to f2673be Compare December 19, 2024 03:11
@hczhu-db hczhu-db changed the title Fix load shedding Polish Pantheon DB load shedding Dec 19, 2024
@hczhu-db hczhu-db changed the title Polish Pantheon DB load shedding Polish Thanos Receive load shedding Dec 19, 2024
}

func (l *Limiter) DecrementPendingRequests() {
newValue := l.pendingRequests.Add(-1)
if l.pendingRequestsGauge != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this would be nil?

if l.maxPendingRequestLimitHit != nil {
l.maxPendingRequestLimitHit.Inc()
}
if l.pendingRequestsGauge != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think tracking pending request should always on, check nil seems unnecessary and hurts the code readability

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's how existing instrumentation works. I believe there is a code path such that those metrics are not initiated.
image

image

@hczhu-db hczhu-db merged commit b480301 into db_main Dec 20, 2024
14 checks passed
@hczhu-db hczhu-db deleted the fix-load-shedding branch December 20, 2024 00:34
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.

3 participants