You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feat]: Race Condition in TaskUpdater for Terminal States #278
Is your feature request related to a problem? Please describe.
The TaskUpdater is vulnerable to a race condition when handling terminal states. Concurrent updates (e.g., two simultaneous calls to complete() and failed()) can lead to inconsistent task statuses because the state checks are not atomic.
A locking mechanism is needed to ensure that once a task begins to transition to a terminal state, no other updates can be processed.
Describe the solution you'd like
Steps to reproduce the behavior:
Trigger two simultaneous async calls to update a task's status to two different terminal states.
For example: asyncio.gather(task_updater.complete(), task_updater.failed()).
Observe that it may be possible for both operations to proceed further than they should, creating a race condition.
Activity
feat(server): Add lock to TaskUpdater to prevent race conditions (#279)