Flagsmith/flagsmith

Race condition in deleting segments

已關閉

#7,354 建立於 2026年4月27日

 (1 則留言) (0 個反應) (0 位負責人)Python (264 個分叉)batch import
buggood first issue

倉庫指標

星標
 (3,475 顆星)
PR 合併指標
 (平均合併 3天 7小時) (30 天內合併 157 個 PR)

描述

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.

貢獻者指南