-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Wait for all previous objects to be deleted before continuing #4037
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
Conversation
|
I'm pretty confident that these issues would have eventually resolved themselves since the task would have kept retrying naturally until the objects were actually removed, but this is a bit more sane way to handle it. |
src/sentry/tasks/deletion.py
Outdated
|
|
||
| # Wait until all Teams have actually been deleted before continuing | ||
| if Team.objects.filter(organization=o).exists(): | ||
| current.retry(exc=Exception('waiting a bit'), countdown=15) |
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.
Don't use retry as I'm pretty it has side effects if max retries is enabled
|
It's unclear why this should be needed and I'm not convinced we should make the change as it's likely masking something else. Deletions should just delete with the assumption that any children are working correctly |
|
I could explain better IRL probably. Since this is definitely possible to hit after I fixed a previous issue that was masking this. |
This makes the jobs never finish See also: #4037
Related to 3735627 As a side effect of this previous commit, it's possible that the current task now continues along before all of it's expected objects have actually been removed. This leads to issues when it tries to delete the Team/Organization which has dependent objects still remaining to be deleted. This just adds a check and a try again later to the task until all of the previous tasks are actually finished.
ffb40df to
4a27602
Compare
|
Updated to not use retry, but to enqueue a new task. |
The assumption here is a bit wrong. So the problem is that say, inside |
|
Reviewed 1 of 1 files at r2. Comments from Reviewable |
|
Can we just add return values to delete team / etc Review status: Comments from Reviewable |
Related to 3735627
As a side effect of this previous commit, it's possible that the current
task now continues along before all of it's expected objects have
actually been removed. This leads to issues when it tries to delete the
Team/Organization which has dependent objects still remaining to be
deleted.
This just adds a check and a try again later to the task until all of
the previous tasks are actually finished.
@getsentry/infrastructure
This change is