Skip to content

Conversation

@cursor
Copy link
Contributor

@cursor cursor bot commented Nov 19, 2025

Fixes N+1 queries and concurrency errors during Monitor deletion by batching seat removal.

The MonitorDeletionTask now calls quotas.backend.remove_seats with a list of monitors before individual deletion, centralizing and optimizing seat cleanup.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.


Open in Cursor Open in Web

Co-authored-by: jenn.muengtaweepongsa <jenn.muengtaweepongsa@sentry.io>
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 19, 2025
@codecov
Copy link

codecov bot commented Nov 19, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
29869 1 29868 245
View the top 1 failed test(s) by shortest run time
tests.sentry.deletions.test_monitor.DeleteMonitorTest::test_removes_monitor_seats_before_delete
Stack Traces | 2.03s run time
#x1B[1m#x1B[.../sentry/deletions/test_monitor.py#x1B[0m:70: in test_removes_monitor_seats_before_delete
    assert list(args[1]) == [monitor]
#x1B[1m#x1B[31mE   AssertionError: assert [<Monitor at ...001, name=''>] == [<Monitor at ...001, name=''>]#x1B[0m
#x1B[1m#x1B[31mE     #x1B[0m
#x1B[1m#x1B[31mE     At index 0 diff: <Monitor at 0x7f7f86668f50: id=None, guid=UUID('f38c3159-b8a8-49a0-b238-bab9f819b4b8'), project_id=4557137682432001, name=''> != <Monitor at 0x7f7f843bcb90: id=6, guid=UUID('f38c3159-b8a8-49a0-b238-bab9f819b4b8'), project_id=4557137682432001, name=''>#x1B[0m
#x1B[1m#x1B[31mE     #x1B[0m
#x1B[1m#x1B[31mE     Full diff:#x1B[0m
#x1B[1m#x1B[31mE       [#x1B[0m
#x1B[1m#x1B[31mE     -     <Monitor at 0x7f7f843bcb90: id=6, guid=UUID('f38c3159-b8a8-49a0-b238-bab9f819b4b8'), project_id=4557137682432001, name=''>,#x1B[0m
#x1B[1m#x1B[31mE     ?                        ^^^^^^      ^#x1B[0m
#x1B[1m#x1B[31mE     +     <Monitor at 0x7f7f86668f50: id=None, guid=UUID('f38c3159-b8a8-49a0-b238-bab9f819b4b8'), project_id=4557137682432001, name=''>,#x1B[0m
#x1B[1m#x1B[31mE     ?                        ^^^^^^      ^^^^#x1B[0m
#x1B[1m#x1B[31mE       ]#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants