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 2021/07/19 09:09:07 UTC

[GitHub] [airflow] anitakar commented on pull request #17078: Prevent running `airflow db init\upgrade` in parallel

anitakar commented on pull request #17078:
URL: https://github.com/apache/airflow/pull/17078#issuecomment-882382776


   Basically the problem was that in case of postgres and mysql lock is global on the db and not connected to the db connection.
   
   In case of mssql the lock is connected to the db connection, so it can not be closed before the lock is released.
   
   So what I did is to create separate locks whenever a method closes connection in its code and also passed the session and connection whenever possible as an argument.
   
   Tested e2e with backend mssql by running: airflow db init/upgrade/reset.
   
   upgradedb() method creates its own connection and closes it. Same for create connection methods.


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