mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-16 16:32:47 +00:00
test: Fix shutdown vptr race in BlockFilterIndexSync bench
This commit is contained in:
parent
e09b81638b
commit
fa79098ce2
@ -53,6 +53,9 @@ static void BlockFilterIndexSync(benchmark::Bench& bench)
|
||||
IndexSummary summary = filter_index.GetSummary();
|
||||
assert(summary.synced);
|
||||
assert(summary.best_block_hash == WITH_LOCK(::cs_main, return test_setup->m_node.chainman->ActiveTip()->GetBlockHash()));
|
||||
|
||||
// Shutdown sequence (c.f. Shutdown() in init.cpp)
|
||||
filter_index.Stop();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -64,14 +64,6 @@ BOOST_FIXTURE_TEST_CASE(coinstatsindex_initial_sync, TestChain100Setup)
|
||||
|
||||
BOOST_CHECK(block_index != new_block_index);
|
||||
|
||||
// It is not safe to stop and destroy the index until it finishes handling
|
||||
// the last BlockConnected notification. The BlockUntilSyncedToCurrentChain()
|
||||
// call above is sufficient to ensure this, but the
|
||||
// SyncWithValidationInterfaceQueue() call below is also needed to ensure
|
||||
// TSAN always sees the test thread waiting for the notification thread, and
|
||||
// avoid potential false positive reports.
|
||||
m_node.validation_signals->SyncWithValidationInterfaceQueue();
|
||||
|
||||
// Shutdown sequence (c.f. Shutdown() in init.cpp)
|
||||
coin_stats_index.Stop();
|
||||
}
|
||||
|
||||
@ -61,14 +61,6 @@ BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
|
||||
}
|
||||
}
|
||||
|
||||
// It is not safe to stop and destroy the index until it finishes handling
|
||||
// the last BlockConnected notification. The BlockUntilSyncedToCurrentChain()
|
||||
// call above is sufficient to ensure this, but the
|
||||
// SyncWithValidationInterfaceQueue() call below is also needed to ensure
|
||||
// TSAN always sees the test thread waiting for the notification thread, and
|
||||
// avoid potential false positive reports.
|
||||
m_node.validation_signals->SyncWithValidationInterfaceQueue();
|
||||
|
||||
// shutdown sequence (c.f. Shutdown() in init.cpp)
|
||||
txindex.Stop();
|
||||
}
|
||||
|
||||
@ -70,6 +70,7 @@ BOOST_FIXTURE_TEST_CASE(txospenderindex_initial_sync, TestChain100Setup)
|
||||
BOOST_CHECK_EQUAL((*tx_spender)->block_hash, tip_hash);
|
||||
}
|
||||
|
||||
// Shutdown sequence (c.f. Shutdown() in init.cpp)
|
||||
txospenderindex.Stop();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user