SessionPool idle connections should behave as a FIFO queue (#3951) (#4264)

Co-authored-by: Friedrich Wilckens <friedrich.wilckens@ingramcontent.com>
This commit is contained in:
Aleksandar Fabijanic 2023-11-13 10:28:08 +01:00 committed by GitHub
parent 23463b2e55
commit 54d3c7b351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,7 @@ Session SessionPool::get()
customizeSession(newSession);
PooledSessionHolderPtr pHolder(new PooledSessionHolder(*this, newSession.impl()));
_idleSessions.push_front(pHolder);
_idleSessions.push_back(pHolder);
++_nSessions;
}
else throw SessionPoolExhaustedException(_connector);
@ -261,7 +261,7 @@ void SessionPool::putBack(PooledSessionHolderPtr pHolder)
applySettings(pHolder->session());
pHolder->access();
_idleSessions.push_front(pHolder);
_idleSessions.push_back(pHolder);
}
else --_nSessions;