Merge branch 'MXS-212' into develop

This commit is contained in:
Markus Makela
2015-06-23 17:11:23 +03:00
3 changed files with 26 additions and 12 deletions

View File

@ -2423,6 +2423,9 @@ static bool dcb_set_state_nomutex(
case DCB_STATE_NOPOLLING: case DCB_STATE_NOPOLLING:
switch (new_state) { switch (new_state) {
/** Stopped services which are restarting will go from
* DCB_STATE_NOPOLLING to DCB_STATE_LISTENING.*/
case DCB_STATE_LISTENING:
case DCB_STATE_ZOMBIE: /*< fall through */ case DCB_STATE_ZOMBIE: /*< fall through */
dcb->state = new_state; dcb->state = new_state;
case DCB_STATE_POLLING: /*< ok to try but state can't change */ case DCB_STATE_POLLING: /*< ok to try but state can't change */

View File

@ -330,7 +330,8 @@ poll_remove_dcb(DCB *dcb)
CHK_DCB(dcb); CHK_DCB(dcb);
/*< It is possible that dcb has already been removed from the set */ /*< It is possible that dcb has already been removed from the set */
if (dcb->state != DCB_STATE_POLLING) if (dcb->state != DCB_STATE_POLLING &&
dcb->state != DCB_STATE_LISTENING)
{ {
if (dcb->state == DCB_STATE_NOPOLLING || if (dcb->state == DCB_STATE_NOPOLLING ||
dcb->state == DCB_STATE_ZOMBIE) dcb->state == DCB_STATE_ZOMBIE)

View File

@ -534,11 +534,16 @@ int listeners = 0;
port = service->ports; port = service->ports;
while (port) while (port)
{ {
poll_remove_dcb(port->listener); if(port->listener &&
port->listener->session->state = SESSION_STATE_LISTENER_STOPPED; port->listener->session->state == SESSION_STATE_LISTENER)
listeners++; {
if(poll_remove_dcb(port->listener) == 0)
port = port->next; {
port->listener->session->state = SESSION_STATE_LISTENER_STOPPED;
listeners++;
}
}
port = port->next;
} }
service->state = SERVICE_STATE_STOPPED; service->state = SERVICE_STATE_STOPPED;
@ -562,13 +567,18 @@ int listeners = 0;
port = service->ports; port = service->ports;
while (port) while (port)
{ {
if (poll_add_dcb(port->listener) == 0) { if(port->listener &&
port->listener->session->state = SESSION_STATE_LISTENER; port->listener->session->state == SESSION_STATE_LISTENER_STOPPED)
listeners++; {
} if(poll_add_dcb(port->listener) == 0)
port = port->next; {
port->listener->session->state = SESSION_STATE_LISTENER;
listeners++;
}
}
port = port->next;
} }
service->state = SERVICE_STATE_STARTED;
return listeners; return listeners;
} }