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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
