dabla commented on PR #68377: URL: https://github.com/apache/airflow/pull/68377#issuecomment-4698578355
> > > I wonder if we could also catch the deadlock in this case (`_threading_lock.locked() and threading.get_ident() == self._loop_thread_id` style) to throw a nice error message, pointing the user to update their hook? > > > > > > ``` > > [2026-06-12 07:56:11] ERROR - comms.DeadlockImminentError: comms.send() called from the event loop thread for message 'TaskState' — deadlock will occur as soon as another coroutine calls asend(). Likely cause: BaseHook.get_hook() or BaseHook.get_connection() was called from inside an async task. Use the async equivalents instead: await BaseHook.aget_hook() or await BaseHook.aget_connection(). > > [2026-06-12 07:56:11] ERROR - Offending call stack: > > ... > > ``` > > And there's basically 0 chance of this affecting anyone today, as this is only a surfaces when you use the AsyncPythonOperator, right? (Just thinking about if this will suddenly start failing loads of existing workloads that were working before due to dumb luck) I did exactly the same reflection myself yesterday, but I monkey patched this check to all our environments (even production) to see what comes out of it and until now now exception where raised due to this check (+1200 DAG's), and we use a lot the async PythonOperator with iterate. A possible solution would be to add a config parameter for this check which is disabled by default for example. -- 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]
