x42005e1f commented on issue #50185:
URL: https://github.com/apache/airflow/issues/50185#issuecomment-2917869438

   > [@kaxil](https://github.com/kaxil) [@ashb](https://github.com/ashb) It 
seems to me that having a separate channel for triggerer workloads and API 
communication would be ideal in this scenario to avoid deadlocks IMHO.
   
   There is also a very audacious solution. Let's go back to the thread-level 
lock. If we add an asynchronous lock to it for the current event loop, it will:
   
   1. Guarantee exclusive access for the thread.
   2. Guarantee exclusive access for the task.
   3. But allow access through a synchronous function called by another task.
   
   And let's just suspend the message transmission to the asynchronous task and 
let the response come to the synchronous function first, and resume sending to 
the asynchronous function afterwards. This way we will eliminate both 
collisions and deadlocks - due to cooperative multitasking it can be done 
relatively easily. But this mechanism will have to be implemented properly.
   
   > can this `greenback.ensure_portal()` be opened on global level in trigger 
process, why i am asking is its bit problematic to add this before every 
function that calls from triggerer. Also users have their own custom triggers 
they have to update this before every function call.
   
   Just call somewhere within the current task that will make sync-or-async 
calls. `greenback.ensure_portal()` keeps track of registered tasks, so it can 
be called multiple times.


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