Skip to content

Replace usage of countdown with transaction.on_commit #88091

@markstory

Description

@markstory

We use celery's countdown feature in a few places to delay task scheduling until after db transactions are complete. A better solution for these scenarios is to use transaction.on_commit() to schedule tasks. The usage of countdown in deletions can be removed entirely.

Callsites to update

  • ✅ src/sentry/incidents/logic.py:720 - auto_resolve_snapshot_incidents()
  • ✅ src/sentry/deletions/tasks/scheduled.py : 194 - process_task()
  • ✅ src/sentry/deletions/tasks/hybrid_cloud.py : 232 - process_task()
  • ✅ src/sentry/integrations/jira/webhooks/installed.py : 78 - sync_metadata()
  • ✅ src/sentry/snuba/subscriptions.py : 306 - create_subscription_in_snuba()
  • ✅ src/sentry/snuba/subscriptions.py : 258,282 - delete_subscription_from_snuba()
  • ✅ src/sentry/snuba/subscriptions.py : 225 - update_subscription_in_snuba
  • ✅ src/sentry/models/files/abstractfileblob.py : 232 - delete_file()
  • ✅ src/sentry/tasks/relay.py : 372 - invalidate_project_config()
  • ✅ src/sentry/deletions/tasks/groups.py : 48 - delete_groups()
  • ✅ src/sentry/incidents/tasks.py:170 - auto_resolve_snapshot_incidents()
  • ✅ src/sentry/data_export/tasks.py : 189 - assemble_download()

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions