potiuk commented on pull request #18439:
URL: https://github.com/apache/airflow/pull/18439#issuecomment-927221077
> One question: Would there be race conditions if multiple `airflow`
commands are launched concurrently? i.e. `./breeze start-airflow` launches a
tmux session and five commands together, and both the scheduler and webserver
would want to do migration at the same time.
We have now exclusive locks for migration - in most backends (MsSQL needs to
be re-added as it has been removed - but it should be possible to bring it back
after I discovered where the lock contention came from - I will do it shortly
after this one is merged) .
But I think it's a good point - the lock should be put around the whole
check with this change rather than inside the upgradedb command.
```
with create_global_lock(session=session, pg_lock_id=2,
lock_name="upgrade"):
log.info("Creating tables")
command.upgrade(config, 'heads')
add_default_pool_if_not_exists()
```
--
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]