You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/11/01 02:57:49 UTC

[GitHub] [airflow] NickYadance commented on pull request #27344: Add retry to submit_event in trigger to avoid deadlock

NickYadance commented on PR #27344:
URL: https://github.com/apache/airflow/pull/27344#issuecomment-1297953893

   > @NickYadance did you try this fix? did it resolve the issue? do you think it's possible to write a test for it? i imagine you could might simulate the scenario by managing two sessions. if so, you could write a test that reliably fails without the fix, then add the fix and leave the test.
   > 
   > the reason I ask is because i see that that the retry is within the scope of the session, and i'm not sure whether, if we get a deadlock error, the session will need to be rolled back.
   > 
   > and, another option would be to put `@tenacity.retry(stop=tenacity.stop_after_attempt(MAX_DB_TRIES))` as the outermost decorator, and then each failed attempt would get rolled back and a new session created for the next attempt
   
   No actually. The solution is from here as these are similiar cases. 
   https://github.com/apache/airflow/blob/b29ca4e77d4d80fb1f4d6d4b497a3a14979dd244/airflow/models/trigger.py#L100-L104 
   Working on to reproduce this...


-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org