Hi all, I think I found a possible deadlock in SessionPool shutdown function. I would know what do you think about.
The functions involved are
void SessionPool::onJanitorTimer(Poco::Timer&)
and
void SessionPool::shutdown()
the problem is in shutdown you have
Poco::Mutex::ScopedLock lock(_mutex);
and than
_janitorTimer.stop();
if timer thread is entering onJanitorTimer function you will obtain a deadlock because first line of function is ScopedLock
probably we should
{
Poco::Mutex::ScopedLock lock(_mutex);
if (_shutdown) return;
_shutdown = true;
}
_janitorTimer.stop();
...
or
_shutdown = true;
_janitorTimer.stop();
Poco::Mutex::ScopedLock lock(_mutex);
let me know what you think
Hi all, I think I found a possible deadlock in SessionPool shutdown function. I would know what do you think about.
The functions involved are
void SessionPool::onJanitorTimer(Poco::Timer&)and
void SessionPool::shutdown()the problem is in shutdown you have
Poco::Mutex::ScopedLock lock(_mutex);and than
_janitorTimer.stop();if timer thread is entering onJanitorTimer function you will obtain a deadlock because first line of function is ScopedLock
probably we should
...
or
let me know what you think