-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix not started database shutdown deadlock #59137
Conversation
This is an automated comment for commit a40da92 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page Successful checks
|
known data race in AggregatedDataVariants #58437
another known problem #50933
This timeout looks a bit suspicious, let me investigate |
Look like this is another deadlock (this time with
Another thread:
UPD. Fixed by #59308 |
There was no way for a database that was not started up to properly shutdown. It led to the following deadlock in the main thread:
I replaced
waitDatabaseStarted(true)
with a new functionIDatabase::stopLoading()
which is stronger. In particular, it cancels all pending load and startup tasks. Afterward, it waits for all currently running tasks to avoid races. This way it is now possible to shutdown a database that is not fully loaded. Also, the shutdown of a database stops all its loading activities.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix a deadlock that can happen during the shutdown of the server due to metadata loading failure.