-
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
ref(server): Fix and re-apply #3770 #3854
Conversation
… types (#3770) We currently deal with different envelope states inconsistently: Because the state of a project is encoded into many separate fields and types, it's hard to enforce that the config is validated correctly everywhere that it is used. For example, invalid (i.e. unparsable) project configs are sometimes treated the same as pending, sometimes the same as disabled.
e9434ab
to
5607bd3
Compare
def test_root_project_disabled(mini_sentry, relay): | ||
project_id = 42 | ||
mini_sentry.add_full_project_config(project_id) | ||
disabled_dsn = "00000000000000000000000000000000" | ||
txn = send_transaction_with_dsc(mini_sentry, relay, project_id, disabled_dsn) | ||
assert txn |
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.
This test fails with the previous implementation in #3770.
ProjectState::Disabled => { | ||
relay_log::trace!("Sampling state is disabled ({sampling_key})"); | ||
// We accept events even if its root project has been disabled. | ||
requires_sampling_state = false; |
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.
This was missing in the previous PR: By setting state
to None
, we fell back to enqueueing an envelope if its sampling project was disabled (see test_root_project_disabled
).
Fixes and reapplies #3770.
Above PR had a bug that created a tight spool-unspool loop for disabled projects (see commented test case).
To view the diff with the previous PR, minus latest master changes, see:
https://github.com/getsentry/relay/pull/3854/files/332619c8ff9c5257cd1ea13052ea60e4590df5a4..c320ba6e9666286a61b6dfbf05fb063df24bb331
#skip-changelog