Fixed bugs by moving setting of thread bit mask from polling to DCB closing, fixed other mistakes.
This commit is contained in:
@ -560,6 +560,7 @@ dcb_process_victim_queue(DCB *listofdcb)
|
|||||||
if (dcb_maybe_add_persistent(dcb))
|
if (dcb_maybe_add_persistent(dcb))
|
||||||
{
|
{
|
||||||
/* Have taken DCB into persistent pool, no further killing */
|
/* Have taken DCB into persistent pool, no further killing */
|
||||||
|
dcb = dcb->memdata.next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1858,6 +1859,10 @@ dcb_close(DCB *dcb)
|
|||||||
dcb->dcb_is_zombie = true;
|
dcb->dcb_is_zombie = true;
|
||||||
dcb->memdata.next = zombies;
|
dcb->memdata.next = zombies;
|
||||||
zombies = dcb;
|
zombies = dcb;
|
||||||
|
/*< Set bit for each maxscale thread. This should be done before
|
||||||
|
* the state is changed, so as to protect the DCB from premature
|
||||||
|
* destruction. */
|
||||||
|
bitmask_copy(&dcb->memdata.bitmask, poll_bitmask());
|
||||||
}
|
}
|
||||||
spinlock_release(&zombiespin);
|
spinlock_release(&zombiespin);
|
||||||
}
|
}
|
||||||
@ -1873,7 +1878,7 @@ static bool
|
|||||||
dcb_maybe_add_persistent(DCB *dcb)
|
dcb_maybe_add_persistent(DCB *dcb)
|
||||||
{
|
{
|
||||||
int poolcount = -1;
|
int poolcount = -1;
|
||||||
if (dcb->user
|
if (dcb->user != NULL
|
||||||
&& strlen(dcb->user)
|
&& strlen(dcb->user)
|
||||||
&& dcb->server
|
&& dcb->server
|
||||||
&& dcb->server->persistpoolmax
|
&& dcb->server->persistpoolmax
|
||||||
@ -1888,7 +1893,6 @@ dcb_maybe_add_persistent(DCB *dcb)
|
|||||||
dcb->user)));
|
dcb->user)));
|
||||||
dcb->dcb_is_zombie = false;
|
dcb->dcb_is_zombie = false;
|
||||||
dcb->persistentstart = time(NULL);
|
dcb->persistentstart = time(NULL);
|
||||||
session_unlink_dcb(dcb->session, dcb);
|
|
||||||
spinlock_acquire(&dcb->server->persistlock);
|
spinlock_acquire(&dcb->server->persistlock);
|
||||||
dcb->nextpersistent = dcb->server->persistent;
|
dcb->nextpersistent = dcb->server->persistent;
|
||||||
dcb->server->persistent = dcb;
|
dcb->server->persistent = dcb;
|
||||||
|
@ -368,10 +368,6 @@ poll_remove_dcb(DCB *dcb)
|
|||||||
dcb,
|
dcb,
|
||||||
STRDCBSTATE(dcb->state))));
|
STRDCBSTATE(dcb->state))));
|
||||||
}
|
}
|
||||||
/*< Set bit for each maxscale thread. This should be done before
|
|
||||||
* the state is changed, so as to protect the DCB from premature
|
|
||||||
* destruction. */
|
|
||||||
bitmask_copy(&dcb->memdata.bitmask, poll_bitmask());
|
|
||||||
/*<
|
/*<
|
||||||
* Set state to NOPOLLING and remove dcb from poll set.
|
* Set state to NOPOLLING and remove dcb from poll set.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user