From fc85f89be486d3bce16160a798907dfc35bead52 Mon Sep 17 00:00:00 2001 From: Ilya Eremin Date: Wed, 16 Mar 2022 11:01:51 +0300 Subject: [PATCH] Print ON DISCONNECT trigger name with a stack trace to firebird.log when it is cancelled by a timeout It may help to determine where the trigger is hanging. --- src/jrd/exe.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/jrd/exe.cpp b/src/jrd/exe.cpp index b00419452f..bf9d2942ac 100644 --- a/src/jrd/exe.cpp +++ b/src/jrd/exe.cpp @@ -1252,6 +1252,14 @@ void EXE_execute_triggers(thread_db* tdbb, trigger->req_flags &= ~req_in_use; ex.stuffException(tdbb->tdbb_status_vector); + + if (trigger_action == TRIGGER_DISCONNECT && + !(tdbb->tdbb_flags & TDBB_stack_trace_done) && (tdbb->tdbb_flags & TDBB_sys_error)) + { + stuff_stack_trace(trigger); + tdbb->tdbb_flags |= TDBB_stack_trace_done; + } + trigger_failure(tdbb, trigger); }