Finalise comments; change abort from assert(false) to raise(SIGABRT).

This commit is contained in:
counterpoint
2015-07-07 16:51:22 +01:00
parent be789855ee
commit 4c8aa02c31
6 changed files with 10 additions and 5 deletions

View File

@ -60,6 +60,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <signal.h>
#include <dcb.h> #include <dcb.h>
#include <spinlock.h> #include <spinlock.h>
#include <server.h> #include <server.h>
@ -1908,7 +1909,7 @@ dcb_close(DCB *dcb)
pthread_self(), pthread_self(),
dcb, dcb,
STRDCBSTATE(dcb->state)))); STRDCBSTATE(dcb->state))));
assert(false); raise(SIGABRT);
} }
/** /**

View File

@ -15,10 +15,12 @@
* *
* Copyright MariaDB Corporation Ab 2013-2014 * Copyright MariaDB Corporation Ab 2013-2014
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h>
#include <sys/epoll.h> #include <sys/epoll.h>
#include <errno.h> #include <errno.h>
#include <poll.h> #include <poll.h>
@ -290,7 +292,7 @@ poll_add_dcb(DCB *dcb)
pthread_self(), pthread_self(),
dcb, dcb,
STRDCBSTATE(dcb->state)))); STRDCBSTATE(dcb->state))));
assert(false); raise(SIGABRT);
} }
if (DCB_STATE_POLLING == dcb->state if (DCB_STATE_POLLING == dcb->state
|| DCB_STATE_LISTENING == dcb->state) || DCB_STATE_LISTENING == dcb->state)
@ -379,7 +381,7 @@ poll_remove_dcb(DCB *dcb)
* things have gone wrong and we crash. * things have gone wrong and we crash.
*/ */
if (rc) rc = poll_resolve_error(dcb, errno, false); if (rc) rc = poll_resolve_error(dcb, errno, false);
if (rc) assert(false); if (rc) raise(SIGABRT);
/*< Set bit for each maxscale thread */ /*< Set bit for each maxscale thread */
bitmask_copy(&dcb->memdata.bitmask, poll_bitmask()); bitmask_copy(&dcb->memdata.bitmask, poll_bitmask());
return rc; return rc;
@ -449,7 +451,7 @@ poll_resolve_error(DCB *dcb, int errornum, bool adding)
if (ENOMEM == errornum) assert (!(ENOMEM == errornum)); if (ENOMEM == errornum) assert (!(ENOMEM == errornum));
if (EPERM == errornum) assert (!(EPERM == errornum)); if (EPERM == errornum) assert (!(EPERM == errornum));
/* Undocumented error number */ /* Undocumented error number */
assert(false); raise(SIGABRT);
} }
#define BLOCKINGPOLL 0 /*< Set BLOCKING POLL to 1 if using a single thread and to make #define BLOCKINGPOLL 0 /*< Set BLOCKING POLL to 1 if using a single thread and to make

View File

@ -33,7 +33,6 @@
* Date Who Description * Date Who Description
* 08/07/2013 Massimiliano Pinto Initial version * 08/07/2013 Massimiliano Pinto Initial version
* 09/07/2013 Massimiliano Pinto Added /show?dcb|session for all dcbs|sessions * 09/07/2013 Massimiliano Pinto Added /show?dcb|session for all dcbs|sessions
* 07/07/2015 Martin Brampton Fixed problems with DCBs on errors
* *
* @endverbatim * @endverbatim
*/ */

View File

@ -58,6 +58,7 @@ extern __thread log_info_t tls_log_info;
* Revision History * Revision History
* Date Who Description * Date Who Description
* 13/06/2014 Mark Riddoch Initial implementation * 13/06/2014 Mark Riddoch Initial implementation
* 07/07/15 Martin Brampton Correct failure handling
* *
* @endverbatim * @endverbatim
*/ */

View File

@ -36,6 +36,7 @@
* 03/10/2014 Massimiliano Pinto Added netmask for wildcard in IPv4 hosts. * 03/10/2014 Massimiliano Pinto Added netmask for wildcard in IPv4 hosts.
* 24/10/2014 Massimiliano Pinto Added Mysql user@host @db authentication support * 24/10/2014 Massimiliano Pinto Added Mysql user@host @db authentication support
* 10/11/2014 Massimiliano Pinto Charset at connect is passed to backend during authentication * 10/11/2014 Massimiliano Pinto Charset at connect is passed to backend during authentication
* 07/07/15 Martin Brampton Fix problem recognising null password
* *
*/ */

View File

@ -67,6 +67,7 @@ extern __thread log_info_t tls_log_info;
* Date Who Description * Date Who Description
* 17/06/2013 Mark Riddoch Initial version * 17/06/2013 Mark Riddoch Initial version
* 17/07/2013 Mark Riddoch Addition of login phase * 17/07/2013 Mark Riddoch Addition of login phase
* 07/07/2015 Martin Brampton Call unified dcb_close on error
* *
* @endverbatim * @endverbatim
*/ */