From 2a4addc298261dad2d0e52789ad345a2a2a1db9c Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 16 Sep 2016 01:13:52 +0300 Subject: [PATCH] Clear waiting results flag on client errors When a backend causes an error and it should be sent to the client, the backend reference was closed but the waiting results state was not cleared. This caused a debug assertion to be hit. --- server/modules/routing/readwritesplit/readwritesplit.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index dd2b8a7e7..07b768e8b 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -4395,6 +4395,10 @@ static void handle_error_reply_client(SESSION *ses, ROUTER_CLIENT_SES *rses, CHK_BACKEND_REF(bref); bref_clear_state(bref, BREF_IN_USE); bref_set_state(bref, BREF_CLOSED); + if (BREF_IS_WAITING_RESULT(bref)) + { + bref_clear_state(bref, BREF_WAITING_RESULT); + } } if (sesstate == SESSION_STATE_ROUTER_READY)