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

feat(spool): Check preconditions before unspooling #3989

Merged
merged 17 commits into from
Sep 10, 2024

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Sep 5, 2024

In the new spooler design, all envelopes go into the envelope buffer unconditionally (as long as it has capacity), but we must check memory capacity and global config readiness before unspooling:

image

ref: https://github.com/getsentry/team-ingest/issues/345

#skip-changelog

@jjbayer jjbayer changed the base branch from master to ref/global-config-watch September 5, 2024 12:45
@jjbayer jjbayer changed the title feat(spool): Only dequeue if memory available feat(spool): Check preconditions before unspooling Sep 5, 2024
if state.memory_checker().check_memory().is_exceeded() {
// NOTE: Long-term, we should not reject the envelope here, but spool it to disk instead.
// This will be fixed with the new spool implementation.
if state.envelope_buffer().is_none() && state.memory_checker().check_memory().is_exceeded() {
Copy link
Member Author

Choose a reason for hiding this comment

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

In V2 mode, this check is harmful and can lead to unnecessary event loss.

@jjbayer jjbayer marked this pull request as ready for review September 5, 2024 13:18
@jjbayer jjbayer requested a review from a team as a code owner September 5, 2024 13:18
Copy link
Member

@iambriccardo iambriccardo left a comment

Choose a reason for hiding this comment

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

LGTM

relay-server/src/services/buffer/mod.rs Outdated Show resolved Hide resolved
relay-server/src/services/buffer/mod.rs Outdated Show resolved Hide resolved
jjbayer added a commit that referenced this pull request Sep 9, 2024
Remove the extra async message by returning the service's watch handle
directly from `GlobalConfigService`'s constructor.

This prepares for #3989, which
subscribes the envelope buffer service to global config.
Base automatically changed from ref/global-config-watch to master September 9, 2024 10:12
@jjbayer jjbayer merged commit 25a3b7a into master Sep 10, 2024
23 checks passed
@jjbayer jjbayer deleted the feat/buffer-check-mem branch September 10, 2024 06:01
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