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

ref(server): Fix and re-apply #3770 #3854

Merged
merged 7 commits into from
Jul 24, 2024
Merged

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Jul 23, 2024

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

jjbayer added 4 commits July 22, 2024 11:31
… 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.
@jjbayer jjbayer self-assigned this Jul 23, 2024
@jjbayer jjbayer force-pushed the feat/unify-project-states-again branch from e9434ab to 5607bd3 Compare July 23, 2024 15:28
Comment on lines +271 to +276
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
Copy link
Member Author

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.

@jjbayer jjbayer changed the title Feat/unify project states again ref(server): Fix and re-apply #3770 Jul 23, 2024
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;
Copy link
Member Author

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).

@jjbayer jjbayer marked this pull request as ready for review July 23, 2024 15:37
@jjbayer jjbayer requested a review from a team as a code owner July 23, 2024 15:37
@jjbayer jjbayer marked this pull request as draft July 23, 2024 15:56
@jjbayer jjbayer marked this pull request as ready for review July 24, 2024 08:15
@jjbayer jjbayer merged commit 441d178 into master Jul 24, 2024
24 of 25 checks passed
@jjbayer jjbayer deleted the feat/unify-project-states-again branch July 24, 2024 10:39
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