-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat(spooler): Add last_peek value in the priority #3922
Conversation
@@ -20,6 +20,7 @@ | |||
- Extract `user.geo.country_code` into span indexed. ([#3911](https://github.com/getsentry/relay/pull/3911)) | |||
- Add `span.system` tag to span metrics ([#3913](https://github.com/getsentry/relay/pull/3913)) | |||
- Extract client sdk from transaction into profiles. ([#3915](https://github.com/getsentry/relay/pull/3915)) | |||
- Add `last_peek` field to the `Priority` struct. ([#3922](https://github.com/getsentry/relay/pull/3922)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need a changelog entry for this, it is a very technical description.
let Some(( | ||
QueueItem { | ||
key: stack_key, | ||
value: _, | ||
}, | ||
_, | ||
)) = self.priority_queue.peek() | ||
else { | ||
return Ok(None); | ||
}; | ||
|
||
let stack_key = *stack_key; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested:
let Some(( | |
QueueItem { | |
key: stack_key, | |
value: _, | |
}, | |
_, | |
)) = self.priority_queue.peek() | |
else { | |
return Ok(None); | |
}; | |
let stack_key = *stack_key; | |
let Some(( | |
QueueItem { | |
key: &stack_key, | |
value: _, | |
}, | |
_, | |
)) = self.priority_queue.peek() | |
else { | |
return Ok(None); | |
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried already but it was not possible :(
This PR adds the
last_peek
field to thePriority
struct, which defines the priority of the stacks.The rationale behind the implementation is that assuming we have the same readiness and received_at time and keep peeking the stack, we will always get the same element. We want to avoid this and rather have a different element returned at every peek to avoid blocking stacks.
Closes: https://github.com/getsentry/team-ingest/issues/523