From cfa599aea82a5a204455bc0c6347bd92e9b9526b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 27 Apr 2018 00:23:45 +0300 Subject: [PATCH] MXS-1833: Force all maxinfo traffic to the main thread The same problem that caused maxadmin to lock up was also what caused maxinfo to lock up. The concurrent access to the legacy administrative functions caused deadlocks. --- server/core/dcb.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/core/dcb.cc b/server/core/dcb.cc index f2fc5f247..7eb8bb7f0 100644 --- a/server/core/dcb.cc +++ b/server/core/dcb.cc @@ -3420,13 +3420,14 @@ int poll_add_dcb(DCB *dcb) worker_id = MXS_WORKER_ALL; } else if (dcb->dcb_role == DCB_ROLE_CLIENT_HANDLER && - strcasecmp(dcb->service->routerModule, "cli") == 0) + (strcasecmp(dcb->service->routerModule, "cli") == 0 || + strcasecmp(dcb->service->routerModule, "maxinfo") == 0)) { - // If the DCB refers to an accepted maxadmin socket, we force it + // If the DCB refers to an accepted maxadmin/maxinfo socket, we force it // to the main thread. That's done in order to prevent a deadlock - // that may happen if there are multiple concurrent maxadmin calls, + // that may happen if there are multiple concurrent administrative calls, // handled by different worker threads. - // See: https://jira.mariadb.org/browse/MXS-1805 + // See: https://jira.mariadb.org/browse/MXS-1805 and https://jira.mariadb.org/browse/MXS-1833 new_state = DCB_STATE_POLLING; dcb->poll.thread.id = 0; worker_id = dcb->poll.thread.id;