Core/DBLayer:
- Fix a race condition in KeepAlive() when connections are using mysql context when ping is called. - Don´t wait for locks to be released on a connection when pinging, this means the connection is not idle and locking is redundant. Patch by admin@****.net Fixes issue #4599 --HG-- branch : trunk
This commit is contained in:
@@ -37,7 +37,6 @@ class PingOperation : public SQLOperation
|
|||||||
/// Operation for idle delaythreads
|
/// Operation for idle delaythreads
|
||||||
bool Execute()
|
bool Execute()
|
||||||
{
|
{
|
||||||
for (;;)
|
|
||||||
if (m_conn->LockIfReady())
|
if (m_conn->LockIfReady())
|
||||||
{
|
{
|
||||||
m_conn->Ping();
|
m_conn->Ping();
|
||||||
@@ -305,9 +304,16 @@ class DatabaseWorkerPool
|
|||||||
|
|
||||||
void KeepAlive()
|
void KeepAlive()
|
||||||
{
|
{
|
||||||
/// Ping syncrhonous connections
|
/// Ping synchronous connections
|
||||||
for (uint8 i = 0; i < m_connections[IDX_SYNCH].size(); ++i)
|
for (uint8 i = 0; i < m_connections[IDX_SYNCH].size(); ++i)
|
||||||
m_connections[IDX_SYNCH][i]->Ping();
|
{
|
||||||
|
T* t = m_connections[IDX_SYNCH][i];
|
||||||
|
if (t->LockIfReady())
|
||||||
|
{
|
||||||
|
t->Ping();
|
||||||
|
t->Unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Assuming all worker threads are free, every worker thread will receive 1 ping operation request
|
/// Assuming all worker threads are free, every worker thread will receive 1 ping operation request
|
||||||
/// If one or more worker threads are busy, the ping operations will not be split evenly, but this doesn't matter
|
/// If one or more worker threads are busy, the ping operations will not be split evenly, but this doesn't matter
|
||||||
|
|||||||
Reference in New Issue
Block a user