diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index 5f1ab1251e0..fbc5bbb9982 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -4104,6 +4104,11 @@ void JRD_print_procedure_info(thread_db* tdbb, const char* mesg) dbb->dbb_ast_flags &= ~DBB_monitor_off; LCK_lock(tdbb, dbb->dbb_monitor_lock, LCK_SR, LCK_WAIT); + // While waiting for return from LCK_lock call above the blocking AST (see + // DatabaseSnapshot::blockingAst) was called and set DBB_monitor_off flag + // again. But it not released lock as lck_id was unknown at that moment. + // Do it now to not block another process waiting for a monitoring lock. + if (dbb->dbb_ast_flags & DBB_monitor_off) LCK_release(tdbb, dbb->dbb_monitor_lock); } @@ -4207,7 +4212,8 @@ static void check_database(thread_db* tdbb) status_exception::raise(Arg::Gds(isc_cancelled)); } - // Enable signal handler for the monitoring stuff + // Enable signal handler for the monitoring stuff. + // See also comments in JRD_reshedule. if (dbb->dbb_ast_flags & DBB_monitor_off) {