villebro commented on issue #29839: URL: https://github.com/apache/superset/issues/29839#issuecomment-3819435373
@aminghadersohi I fixed the myriad race issues in the previous implementation. Here's the summary of the approach taken from the PR description: ### Distributed Locking GTF uses distributed locks to prevent race conditions. Commands acquire a lock keyed by `dedup_key` before deciding what DAO operations to execute based on task state. | Command | Condition | DAO Operations | |---------|-----------|----------------| | `SubmitTaskCommand` | No existing task | `create_task()` (auto-subscribes creator) | | `SubmitTaskCommand` | Task exists | `add_subscriber()` | | `CancelTaskCommand` | `subscriber_count <= 1` | `abort_task()` | | `CancelTaskCommand` | `subscriber_count > 1` | `remove_subscriber()` | | `UpdateTaskCommand` | Always | `update()` | DAOs perform pure data operations and assume the caller holds the lock. The lock uses Superset's existing `KeyValueDistributedLock`. --- For waiting for async tasks to complete, eventually we'll have webhooks, but for now you'll just have to poll unfortunately. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
