Skip to content

Commit

Permalink
Handle early exit in DBErrorHandlingFSTests
Browse files Browse the repository at this point in the history
Summary: To avoid use-after-free on custom env on ASSERT_WHATEVER
failure.

This is motivated by a rare crash seen in DBErrorHandlingFSTest.WALWriteError
(VersionSet::GetObsoleteFiles in a SstFileManagerImpl::ClearError
thread) and wanting to rule out this being related to that.

Test Plan: manually seeing ASSERT_WHATEVER failures, especially under
ASAN
  • Loading branch information
pdillinger committed May 14, 2024
1 parent 1567d50 commit d65a7b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions db/error_handler_fs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ class DBErrorHandlingFSTest : public DBTestBase {
fault_env_.reset(new CompositeEnvWrapper(env_, fault_fs_));
}

~DBErrorHandlingFSTest() {
// Before destroying fault_env_
SyncPoint::GetInstance()->DisableProcessing();
SyncPoint::GetInstance()->LoadDependency({});
SyncPoint::GetInstance()->ClearAllCallBacks();
Close();
}

std::string GetManifestNameFromLiveFiles() {
std::vector<std::string> live_files;
uint64_t manifest_size;
Expand Down

0 comments on commit d65a7b9

Please sign in to comment.