MXS-1875 Add fd and make note of DCB simultaneously

The fact that a client dcb was immediately added to the epoll-
instance of the relevant worker (possible, since that is thread-
safe), but was added to the book-keeping via the message mechanism
(necessary, since that is not thread-safe), meant that if the
connection was closed before the message was delivered, the handling
of the message then caused an access error.

Now the fd is also added to the epoll-instance via the messaging
mechanism, so the problem can no longer occur. The only fds this
affects are connections made to maxadmin or maxinfo as they are
always handled by the main thread due to deadlock issues.
This commit is contained in:
Johan Wikman
2018-05-21 17:47:44 +03:00
parent 096f5e4dc6
commit f166b50b37
2 changed files with 117 additions and 38 deletions

View File

@ -232,13 +232,6 @@ void dcb_close(DCB *);
*/
void dcb_close_in_owning_thread(DCB *dcb);
/**
* Add a DCB to the owner's list
*
* @param dcb DCB to add
*/
void dcb_add_to_list(DCB *dcb);
void printAllDCBs(); /* Debug to print all DCB in the system */
void printDCB(DCB *); /* Debug print routine */
void dprintDCBList(DCB *); /* Debug print DCB list statistics */