dcb.c:dcb_write accept also dcb state DCB_STATE_NOPOLLING since it only means that dcb has been removed from epoll set but it is still possible to write to it. Bug #384 http://bugs.skysql.com/show_bug.cgi?id=384 session.h:added new state for SESSION, SESSION_STATE_ROUTER_READY which follows SESSION_STATE_READY. The difference is that ROUTER_READY is set only after router session is successfully created while READY means that session still lacks router. session.c:set SESSION_STATE_ROUTER_READY when router is created. mysql_backend.c:gw_read_backend_event, added SESSION_STATE_ROUTER_READY check before router session is closed. Changed chec kso that it doesn't block in infinite loop (although it shouldn't be possible anyway). mysql_backend.c:gw_error_backend_event, added similar check before session is closed.
This commit is contained in:
@ -105,7 +105,7 @@ session_alloc(SERVICE *service, DCB *client_dcb)
|
||||
session->refcount = 1;
|
||||
/*<
|
||||
* This indicates that session is ready to be shared with backend
|
||||
* DCBs.
|
||||
* DCBs. Note that this doesn't mean that router is initialized yet!
|
||||
*/
|
||||
session->state = SESSION_STATE_READY;
|
||||
|
||||
@ -145,6 +145,7 @@ session_alloc(SERVICE *service, DCB *client_dcb)
|
||||
}
|
||||
}
|
||||
spinlock_acquire(&session_spin);
|
||||
session->state = SESSION_STATE_ROUTER_READY;
|
||||
session->next = allSessions;
|
||||
allSessions = session;
|
||||
spinlock_release(&session_spin);
|
||||
|
||||
Reference in New Issue
Block a user