Attempt solution to crash caused by leaving link to backend DCB in router session.

This commit is contained in:
Martin Brampton
2015-09-05 08:53:19 +01:00
parent 42c9532a56
commit 4a1ad3df69
2 changed files with 10 additions and 1 deletions

View File

@ -1145,7 +1145,6 @@ gw_backend_hangup(DCB *dcb)
spinlock_release(&session->ses_lock); spinlock_release(&session->ses_lock);
} }
ss_dassert(dcb->dcb_errhandle_called); ss_dassert(dcb->dcb_errhandle_called);
dcb_close(dcb);
retblock: retblock:
return 1; return 1;

View File

@ -74,6 +74,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <signal.h>
#include <service.h> #include <service.h>
#include <server.h> #include <server.h>
#include <router.h> #include <router.h>
@ -855,6 +856,7 @@ static void handleError(
DCB *client_dcb; DCB *client_dcb;
SESSION *session = backend_dcb->session; SESSION *session = backend_dcb->session;
session_state_t sesstate; session_state_t sesstate;
ROUTER_CLIENT_SES *router_cli_ses = (ROUTER_CLIENT_SES *)router_session;
/** Reset error handle flag from a given DCB */ /** Reset error handle flag from a given DCB */
if (action == ERRACT_RESET) if (action == ERRACT_RESET)
@ -889,6 +891,14 @@ static void handleError(
spinlock_release(&session->ses_lock); spinlock_release(&session->ses_lock);
} }
if (backend_dcb != router_cli_ses->backend_dcb)
{
/* Linkages have gone badly wrong - this may not be best solution */
raise(SIGABRT);
}
router_cli_ses->backend_dcb = NULL;
dcb_close(backend_dcb);
/** false because connection is not available anymore */ /** false because connection is not available anymore */
*succp = false; *succp = false;
} }