SameerMesiah97 opened a new pull request, #62623:
URL: https://github.com/apache/airflow/pull/62623

   **Description**
   
   This change refactors timeout handling in `DatabricksSqlHook.run()` to 
replace implicit timeout detection based on `Timer.is_alive()` with explicit 
signaling using a `threading.Event`. Previously, timeout classification relied 
on inferring whether the background timer thread had completed, which coupled 
error handling logic to thread lifecycle behavior. This refactor introduces 
explicit timeout signaling in `create_timeout_thread()` and updates `run()` to 
check that signal instead of inspecting thread state.
   
   The refactor preserves existing cancellation semantics and exception types 
while removing reliance on thread liveness inference.
   
   **Rationale**
   
   The previous implementation inferred timeout occurrence from the lifecycle 
state of a `threading.Timer`, making the logic harder to reason about and tests 
dependent on implicit thread behavior. The inline TODO noted that this logic 
should be adjusted to make testing easier. By introducing explicit timeout 
signaling, timeout classification becomes deterministic, clearer, and easier to 
test without relying on thread internals.
   
   **Tests**
   
   Timeout-related tests were updated to simulate timeout conditions by mocking 
`create_timeout_thread` and the associated timeout signal rather than relying 
on `threading.Timer` behavior.
   
   **Backwards Compatibility**
   
   No changes to public APIs or behavior.


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

Reply via email to