x42005e1f commented on issue #63913: URL: https://github.com/apache/airflow/issues/63913#issuecomment-4106374742
> could you elaborate what other options in favour your referring I still think the best approach is to tackle the problem at its root and simply let all writes (every piece of code that previously used `SUPERVISOR_COMMS.lock`) run in a single worker thread; the specific implementation details are not that important. Since this will be a separate thread, blocking the event loop will not affect its execution, and therefore all requests will execute without hanging (regardless of the order in which they were sent or by whom). The problem of blocking calls in an asynchronous context could be detected by checking `asyncio._get_running_loop() is not None` and raising warnings. Otherwise, it would not actually be a problem (even if mixing calls of different natures looks messy), would not lead to code breakage, and over time, all such places could be safely identified and rewritten in a more canonical way. On the other hand, that would also remove the stimulus to actually change anything. However, the above applies to the situation as I remember it at the time of the discussion (which I joined because the deadlock occurred in my primitive). Currently, an approach is being used that relies on asyncio and `asgiref.sync`, and which addresses the symptoms rather than the cause. I doubt I can offer anything new here: the existing PRs (you can [search for "AsyncToSync"](https://github.com/apache/airflow/pulls?q=is%3Apr%20AsyncToSync)) already contain a whole range of different solutions and workarounds. -- 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]
