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

   <!-- Bito Reply -->
   The flagged issue correctly identifies a potential race condition where a 
query might continue running if cancellation is attempted before the driver has 
populated the `active_command_id`. The current implementation in the PR 
addresses this by setting `has_query_id_before_execute = False`, which signals 
to the system that the cancel ID is not available until after execution. This 
ensures that the system does not attempt to cancel using an invalid or missing 
ID, preventing the silent no-op behavior described in the review comment.
   
   This implementation is correct for the Databricks engine spec as it aligns 
with the driver's behavior where the command ID is only available 
post-execution. No further code changes are required to resolve this specific 
race condition.
   
   **superset/db_engine_specs/databricks.py**
   ```
   # The driver only populates `cursor.active_command_id` once a statement has
       # actually been executed, so the cancel id can't be captured up front 
like
       # it can for engines where it's tied to the session rather than the 
query.
       has_query_id_before_execute = False
   ```


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