Fix mismatch of int sizes; move calculation of maximum size of persistent pool to a better location.
This commit is contained in:
@ -2971,6 +2971,7 @@ dcb_persistent_clean_count(DCB *dcb, bool cleanall)
|
|||||||
}
|
}
|
||||||
persistentdcb = nextdcb;
|
persistentdcb = nextdcb;
|
||||||
}
|
}
|
||||||
|
server->persistmax = MAX(server->persistmax, count);
|
||||||
spinlock_release(&server->persistlock);
|
spinlock_release(&server->persistlock);
|
||||||
/** Call possible callback for this DCB in case of close */
|
/** Call possible callback for this DCB in case of close */
|
||||||
while (disposals)
|
while (disposals)
|
||||||
|
|||||||
@ -150,12 +150,10 @@ DCB *
|
|||||||
server_get_persistent(SERVER *server, char *user, const char *protocol)
|
server_get_persistent(SERVER *server, char *user, const char *protocol)
|
||||||
{
|
{
|
||||||
DCB *dcb, *previous = NULL;
|
DCB *dcb, *previous = NULL;
|
||||||
int poolsize;
|
|
||||||
|
|
||||||
if (server->persistent && (poolsize = dcb_persistent_clean_count(server->persistent, false)) && server->persistent)
|
if (server->persistent && dcb_persistent_clean_count(server->persistent, false) && server->persistent)
|
||||||
{
|
{
|
||||||
spinlock_acquire(&server->persistlock);
|
spinlock_acquire(&server->persistlock);
|
||||||
server->persistmax = MAX(server->persistmax, poolsize);
|
|
||||||
dcb = server->persistent;
|
dcb = server->persistent;
|
||||||
while (dcb) {
|
while (dcb) {
|
||||||
if (dcb->user
|
if (dcb->user
|
||||||
|
|||||||
@ -104,7 +104,7 @@ typedef struct server {
|
|||||||
SPINLOCK persistlock; /**< Lock for adjusting the persistent connections list */
|
SPINLOCK persistlock; /**< Lock for adjusting the persistent connections list */
|
||||||
long persistpoolmax; /**< Maximum size of persistent connections pool */
|
long persistpoolmax; /**< Maximum size of persistent connections pool */
|
||||||
long persistmaxtime; /**< Maximum number of seconds connection can live */
|
long persistmaxtime; /**< Maximum number of seconds connection can live */
|
||||||
long persistmax; /**< Maximum pool size actually achieved since startup */
|
int persistmax; /**< Maximum pool size actually achieved since startup */
|
||||||
#if defined(SS_DEBUG)
|
#if defined(SS_DEBUG)
|
||||||
skygw_chk_t server_chk_tail;
|
skygw_chk_t server_chk_tail;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user