Flagsmith/flagsmith

Race condition in deleting segments

Open

#7.354 aberto em 27 de abr. de 2026

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)Python (264 forks)batch import
buggood first issue

Métricas do repositório

Stars
 (3.475 stars)
Métricas de merge de PR
 (Mesclagem média 3d 7h) (157 fundiu PRs em 30d)

Description

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.

Guia do colaborador