bito-code-review[bot] commented on PR #43942:
URL: https://github.com/apache/superset/pull/43942#issuecomment-5561085844

   <!-- Bito Reply -->
   The flagged issue is correct. In the current implementation, when an 
asynchronous SQL Lab query is cancelled via `stop_query`, the 
`CancelTaskCommand` is triggered for the GTF task, but the `Query` row status 
is not explicitly updated to `STOPPED` if the task is still pending. The task's 
abort handler is expected to handle this, but if it does not, the query remains 
in a `PENDING` state.
   
   To resolve this, you should ensure that the `Query` status is updated to 
`STOPPED` when the task is cancelled. You can modify `superset/daos/query.py` 
to update the query status after calling `CancelTaskCommand`.
   
   Would you like me to fetch all other comments on this PR to validate and 
implement fixes for them as well?
   
   **superset/daos/query.py**
   ```
   if task is not None:
               CancelTaskCommand(task.uuid).run()
               query.status = QueryStatus.STOPPED
               db.session.commit()
               return
   ```


-- 
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]

Reply via email to