8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 09:20:39 +01:00

Let Applier to shutdown correctly on bug-checked database

This commit is contained in:
Vlad Khorsun 2024-03-12 21:09:44 +02:00
parent 0d35f3c9aa
commit 5d7e79686a
2 changed files with 9 additions and 6 deletions

View File

@ -6532,8 +6532,7 @@ void JReplicator::freeEngineData(Firebird::CheckStatusWrapper* user_status)
{
try
{
EngineContextHolder tdbb(user_status, this, FB_FUNCTION);
check_database(tdbb);
EngineContextHolder tdbb(user_status, this, FB_FUNCTION, AttachmentHolder::ATT_NO_SHUTDOWN_CHECK);
try
{

View File

@ -271,16 +271,20 @@ Applier* Applier::create(thread_db* tdbb)
void Applier::shutdown(thread_db* tdbb)
{
const auto dbb = tdbb->getDatabase();
const auto attachment = tdbb->getAttachment();
cleanupTransactions(tdbb);
CMP_release(tdbb, m_request);
if (!(dbb->dbb_flags & DBB_bugcheck))
{
cleanupTransactions(tdbb);
CMP_release(tdbb, m_request);
}
m_request = nullptr; // already deleted by pool
m_record = nullptr; // already deleted by pool
m_bitmap = nullptr; // already deleted by pool
attachment->att_repl_appliers.findAndRemove(this);
if (attachment)
attachment->att_repl_appliers.findAndRemove(this);
if (m_interface)
{