8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 22:43:03 +01:00

More reliable cleanup for the applier. This should fix replicator crashes after replica shutdown.

This commit is contained in:
Dmitry Yemanov 2023-02-03 20:15:52 +03:00
parent 4848fbe6cf
commit d7d16682cf
2 changed files with 5 additions and 7 deletions

View File

@ -6483,9 +6483,8 @@ void JReplicator::freeEngineData(Firebird::CheckStatusWrapper* user_status)
try
{
AutoPtr<Applier> cleanupApplier(applier);
cleanupApplier->shutdown(tdbb);
fb_assert(!applier);
applier->shutdown(tdbb);
applier = nullptr;
}
catch (const Exception& ex)
{
@ -7650,10 +7649,7 @@ void release_attachment(thread_db* tdbb, Jrd::Attachment* attachment, XThreadEns
attachment->att_dsql_instance->dbb_statement_cache->shutdown(tdbb);
while (attachment->att_repl_appliers.hasData())
{
AutoPtr<Applier> cleanupApplier(attachment->att_repl_appliers.pop());
cleanupApplier->shutdown(tdbb);
}
attachment->att_repl_appliers.pop()->shutdown(tdbb);
if (dbb->dbb_crypto_manager)
dbb->dbb_crypto_manager->detach(tdbb, attachment);

View File

@ -285,6 +285,8 @@ void Applier::shutdown(thread_db* tdbb)
m_interface->resetHandle();
m_interface = nullptr;
}
delete this;
}
void Applier::process(thread_db* tdbb, ULONG length, const UCHAR* data)