gopidesupavan commented on issue #50185: URL: https://github.com/apache/airflow/issues/50185#issuecomment-2913817328
> If the problem is the same as what I described (which is likely), the (relatively) easiest way to solve it is to use libraries like [greenback](https://github.com/oremanj/greenback) to execute an asynchronous version when the code runs in a thread with an event loop. Requires explicit portal creation, greenlet support, and interrupt support on the synchronous code side. > > It is also possible to create asynchronous versions of functions to use directly, or delegate them to execute sequentially in the worker thread via `sync_to_async()`, but this can be difficult, especially since [`SUPERVISOR_COMMS.lock` is used even in `__getitem__()`](https://github.com/apache/airflow/blob/7ebba78236b945e0ce569607480f397e5f2e58ba/task-sdk/src/airflow/sdk/execution_time/lazy_sequence.py#L147). > > > BTW GLock where can i find this package i dont see it on PyPI? i will try with this > > You can directly copy the code from gist and make the mentioned change. GLock [was created to provide readers-writer locks](https://github.com/x42005e1f/aiologic/discussions/6) before Grouper appears in a future version of aiologic. Right now my efforts are focused on moving aiologic to the beta development stage, so releases are currently delayed. > > But be aware that if you choose GLock, you will have to deal with the loss of coroutine-safety: in particular, the asynchronous usage you mentioned will be executed in one thread at a time, but will also be able to be executed in different tasks at the same time. @x42005e1f Thats a good suggestion, greenback seems working, did some tests and everything seems fine. no triggers blocked. Looks like this package is not maintained or not sure, no activity since last Feb 2024. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org