mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
PoolWithFailover: Better error reporting [#CONV-8589].
This commit is contained in:
parent
3f72d27c61
commit
bd69b6d606
@ -142,7 +142,7 @@ namespace mysqlxx
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
catch (Poco::Exception & e)
|
||||
catch (const Poco::Exception & e)
|
||||
{
|
||||
if (e.displayText() == "mysqlxx::Pool is full")
|
||||
{
|
||||
@ -150,7 +150,10 @@ namespace mysqlxx
|
||||
}
|
||||
|
||||
app.logger().error("Connection to " + replica.pool->getDescription() + " failed: " + e.displayText());
|
||||
continue;
|
||||
}
|
||||
|
||||
app.logger().error("Connection to " + replica.pool->getDescription() + " failed.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,7 +166,13 @@ namespace mysqlxx
|
||||
return full_pool->pool->Get();
|
||||
}
|
||||
|
||||
throw Poco::Exception("Connections to all replicas failed");
|
||||
std::stringstream message;
|
||||
message << "Connections to all replicas failed: ";
|
||||
for (ReplicasByPriority::const_iterator it = replicas_by_priority.begin(); it != replicas_by_priority.end(); ++it)
|
||||
for (Replicas::const_iterator jt = it->second.begin(); jt != it->second.end(); ++jt)
|
||||
message << (it == replicas_by_priority.begin() && jt == it->second.begin() ? "" : ", ") << jt->pool->getDescription();
|
||||
|
||||
throw Poco::Exception(message.str());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user