diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index 652cea7b7d..44c3cfaf7e 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -6667,11 +6667,21 @@ bool JRD_shutdown_database(Database* dbb, const unsigned flags) fb_assert(!dbb->locked()); + try + { #ifdef SUPERSERVER_V2 - TRA_header_write(tdbb, dbb, 0); // Update transaction info on header page. + TRA_header_write(tdbb, dbb, 0); // Update transaction info on header page. #endif - if (flags & SHUT_DBB_RELEASE_POOLS) - TRA_update_counters(tdbb, dbb); + if (flags & SHUT_DBB_RELEASE_POOLS) + TRA_update_counters(tdbb, dbb); + } + catch (const Exception&) + { + // Swallow exception raised from the physical I/O layer + // (e.g. due to database file being inaccessible). + // User attachment is already destroyed, so there's no chance + // this dbb can be cleaned up after raising an exception. + } // Disable AST delivery as we're about to release all locks