core/rawdb: wait for background freezing to exit when closing freezer #22878
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I revisited #20986, which contains some fixes regarding the shutdown of the background freezer. That PR is now stale, and some of the changes are already applied.
One remaining feature from that PR is to use a waitgroup to ensure that the shutdown takes effect, before proceeding to close the tables and eventually the database. If this is not performed, it may happen that the database is closed, which makes the freezer hit a
log.Crit
, causing an ungraceful termination.This PR adds a waitgroup to the
freezer
to fix that behaviour.Supersedes #20986