From 146b9402456c2f13e7b87dc06b8b32e0d25a8c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 19 Jul 2019 09:39:15 +0300 Subject: [PATCH] Dump statements on fatal signal This should make it easier to figure out what is going on at the time of the crash if statement collection is enabled. --- server/core/gateway.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/core/gateway.cc b/server/core/gateway.cc index 7700b7a85..a77b13138 100644 --- a/server/core/gateway.cc +++ b/server/core/gateway.cc @@ -427,6 +427,14 @@ static void sigfatal_handler(int i) cnf->sysname, cnf->release_string); + if (DCB* dcb = dcb_get_current()) + { + if (dcb->session) + { + session_dump_statements(dcb->session); + } + } + auto cb = [](const char* symbol, const char* cmd) { MXS_ALERT(" %s: %s", symbol, cmd); };