dcb_call_foreach now only calls the callbacks for those DCBs that are connected to the server.
This commit is contained in:
@ -2081,12 +2081,12 @@ dcb_get_next (DCB* dcb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call all the callbacks on all DCB's that match the reason given
|
* Call all the callbacks on all DCB's that match the server and the reason given
|
||||||
*
|
*
|
||||||
* @param reason The DCB_REASON that triggers the callback
|
* @param reason The DCB_REASON that triggers the callback
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
dcb_call_foreach(DCB_REASON reason)
|
dcb_call_foreach(struct server* server, DCB_REASON reason)
|
||||||
{
|
{
|
||||||
LOGIF(LD, (skygw_log_write(LOGFILE_DEBUG,
|
LOGIF(LD, (skygw_log_write(LOGFILE_DEBUG,
|
||||||
"%lu [dcb_call_foreach]",
|
"%lu [dcb_call_foreach]",
|
||||||
@ -2106,7 +2106,8 @@ dcb_call_foreach(DCB_REASON reason)
|
|||||||
|
|
||||||
while (dcb != NULL)
|
while (dcb != NULL)
|
||||||
{
|
{
|
||||||
if (dcb->state == DCB_STATE_POLLING)
|
if (dcb->state == DCB_STATE_POLLING && dcb->server &&
|
||||||
|
strcmp(dcb->server->unique_name,server->unique_name) == 0)
|
||||||
{
|
{
|
||||||
dcb_call_callback(dcb, DCB_REASON_NOT_RESPONDING);
|
dcb_call_callback(dcb, DCB_REASON_NOT_RESPONDING);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -321,7 +321,7 @@ int dcb_remove_callback(DCB *, DCB_REASON, int (*)(struct dcb *, DCB_REASON, vo
|
|||||||
int dcb_isvalid(DCB *); /* Check the DCB is in the linked list */
|
int dcb_isvalid(DCB *); /* Check the DCB is in the linked list */
|
||||||
|
|
||||||
bool dcb_set_state(DCB* dcb, dcb_state_t new_state, dcb_state_t* old_state);
|
bool dcb_set_state(DCB* dcb, dcb_state_t new_state, dcb_state_t* old_state);
|
||||||
void dcb_call_foreach (DCB_REASON reason);
|
void dcb_call_foreach (struct server* server, DCB_REASON reason);
|
||||||
size_t dcb_get_session_id(DCB* dcb);
|
size_t dcb_get_session_id(DCB* dcb);
|
||||||
bool dcb_get_ses_log_info(DCB* dcb, size_t* sesid, int* enabled_logs);
|
bool dcb_get_ses_log_info(DCB* dcb, size_t* sesid, int* enabled_logs);
|
||||||
|
|
||||||
|
|||||||
@ -690,7 +690,7 @@ int log_no_master = 1;
|
|||||||
if (!(SERVER_IS_RUNNING(ptr->server)) ||
|
if (!(SERVER_IS_RUNNING(ptr->server)) ||
|
||||||
!(SERVER_IS_IN_CLUSTER(ptr->server)))
|
!(SERVER_IS_IN_CLUSTER(ptr->server)))
|
||||||
{
|
{
|
||||||
dcb_call_foreach(DCB_REASON_NOT_RESPONDING);
|
dcb_call_foreach(ptr->server,DCB_REASON_NOT_RESPONDING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user