NuDBBackend destructor should not throw #4017
Closed
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.
High Level Overview of Change
The
NuDBBackend
destructor currently may throw an exception. Most C++ folks agree that throwing an exception from a destructor is a bad idea:https://isocpp.org/wiki/faq/exceptions#dtors-shouldnt-throw
The modified code logs the problem that
NuDB
is complaining about atfatal
level, so it is very likely to get into the log. Then it swallows the exception so the exception does not propagate out of the body of the destructor.Context of Change
There's been an unresolved sporadic crash only in certain testing scenarios where
NuDBBackend
might be implicated. While examining the code I noticed that theNuDBBacked
destructor could throw. So I'm patching that up and and improving the logging regarding what NuDB might be complaining about.Type of Change
There should be no behavior change as a result of this pull request. There's no reason to mention it in the release notes.