[MXS-3917] Crash during `set server maintenance --force` Created: 2021-12-15  Updated: 2022-01-10  Resolved: 2022-01-03

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 6.2.0
Fix Version/s: 6.2.1

Type: Bug Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None

Sprint: MXS-SPRINT-147

 Description   

2021-12-14 18:12:25   alert  : 
  /usr/lib64/maxscale/libmaxscale-common.so.1.0.0(_ZN10BackendDCB9hangup_cbEP10MXB_WORKERPK6SERVER+0x3c): server/core/dcb.cc:1865
  /usr/lib64/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase12MessageQueue18handle_poll_eventsEPNS_6WorkerEj+0x98): maxutils/maxbase/src/messagequeue.cc:307
  /usr/lib64/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase6Worker15poll_waiteventsEv+0x221): maxutils/maxbase/src/worker.cc:856
  /usr/lib64/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase6Worker3runEPNS_9SemaphoreE+0x4f): maxutils/maxbase/src/worker.cc:565
  /usr/lib64/maxscale/libmaxscale-common.so.1.0.0(+0x2dcb6f): thread48.o:?
  /lib64/libpthread.so.0(+0x7dd5): pthread_create.c:?
  /lib64/libc.so.6(clone+0x6d): ??:?
alert  : Writing core dump.



 Comments   
Comment by markus makela [ 2021-12-15 ]

I might've managed to reproduce something similar by enabling persistent connections and then executing maxctrl set server <name> maintenance --force with at least one open connection in the pool.

Comment by markus makela [ 2021-12-15 ]

This might be a potential fix for this problem, it does appear to fix the problem I found earlier.

diff --git a/server/core/server.cc b/server/core/server.cc
index acdfa6eead..c2ca0f88b9 100644
--- a/server/core/server.cc
+++ b/server/core/server.cc
@@ -978,7 +978,7 @@ void ServerEndpoint::close()
     {
         auto* dcb = m_conn->dcb();
         // Try to move the connection into the pool. If it fails, close normally.
-        bool moved_to_pool = dcb->manager()->move_to_conn_pool(dcb);
+        bool moved_to_pool = dcb->session()->normal_quit() && dcb->manager()->move_to_conn_pool(dcb);
         if (moved_to_pool)
         {
             mxb_assert(dcb->is_open());

Generated at Thu Feb 08 04:24:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.