Skip to content

Race condition in deleting segments #7354

@sentry

Description

@sentry

Acceptance Criterion

  • The asynchronous task delete_segment ignores it when the segment is already deleted.

Sentry Issue: FLAGSMITH-API-5NB

Segment.DoesNotExist: Segment matching query does not exist.
(3 additional frame(s) were not displayed)
...
  File "segments/tasks.py", line 14, in delete_segment
    Segment.objects.get(pk=segment_id).delete()

Failed to execute task 'tasks.delete_segment', with id 410046727. Exception: Segment matching query does not exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions