dirrao commented on PR #36492:
URL: https://github.com/apache/airflow/pull/36492#issuecomment-1872537980

   > > I have tried accessing the variables from the trigger run function 
multiple times after multiple context switches in event loop. I can access the 
variable values without any issues
   > 
   > Yes. Accessing will work. But the fact that you can do it - does not mean 
you should :).
   > 
   > The problem is that if you do it during the event loop, the access (if not 
using async/await) will block - in I/O or networking and when it is blocked, no 
other triggers are running because event loop runs synchronously. See what 
happens (and warnings you get) when you just "sleep()" for a second or so. Or 
give your Triggered fractional CPU (say 0.05) - then you will see that even 
short - 50ms blocking operation will be disastrous for the event loop.
   
   Yes. You are right. It makes even more sense in the case of request/response 
APIs. However, in airflow, the trigger might run for seconds/minutes/hours (ex: 
S3KeyTrigger, KubernetesPodTrigger, etc.). I believe accessing the credentials 
one time should be ok.


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

Reply via email to