Bug #10543

Missing timeout default initialization in FixedSqlConnectionPool

Added by Steven Köhler 9 months ago. Updated 9 months ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


While investigating a server crash I found a 'FixedSqlConnectionPool::getConnection(): timeout' error message in my server logs, which was thrown in the FixedSqlConnectionPool::handleTimeout function, which is called from FixedSqlConnectionPool::getConnection.

while (impl_->freeList.empty()) {
  LOG_WARN("no free connections, waiting for connection");
  if (impl_->timeout > std::chrono::steady_clock::duration::zero()) {
    if (impl_->connectionAvailable.wait_for(lock, impl_->timeout) == std::cv_status::timeout) {
  } else

Since I did not specify a timeout, and Wt does not set one by default (according to documentation), the handleTimeout function should not have been called. Turned out the timeout member variable does not get initialized, and since the std::chrono::duration default constructor does not initialize it either (see, it just has a random value - in my case it must have been less than a few milliseconds, which, paired with enough simultaneous page calls (from a bot) caused the almost immediate exception.

Note: The following server crash itself was not caused by that exception directly, but happened due to, which was not fixed in that server instance, and since the timeout exception occurred during the applications construction. So no additional issue there.

I implemented a fix for this issue and created a pull request:


Updated by Roel Standaert 9 months ago

  • Status changed from New to Resolved
  • Assignee set to Steven Köhler
  • Target version set to 4.8.0

Updated by Roel Standaert 9 months ago

  • Target version changed from 4.8.0 to 4.7.3

Updated by Roel Standaert 9 months ago

  • % Done changed from 0 to 100

Updated by Roel Standaert 9 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF