Merge pull request #2193 from strk/2.3.x-no-terminate-pgis-dtor
Do not throw in postgis_datasource destruction if backend is down
This commit is contained in:
commit
7351879e6f
1 changed files with 13 additions and 4 deletions
|
@ -445,10 +445,19 @@ postgis_datasource::~postgis_datasource()
|
||||||
CnxPool_ptr pool = ConnectionManager::instance().getPool(creator_.id());
|
CnxPool_ptr pool = ConnectionManager::instance().getPool(creator_.id());
|
||||||
if (pool)
|
if (pool)
|
||||||
{
|
{
|
||||||
shared_ptr<Connection> conn = pool->borrowObject();
|
try {
|
||||||
if (conn)
|
shared_ptr<Connection> conn = pool->borrowObject();
|
||||||
{
|
if (conn)
|
||||||
conn->close();
|
{
|
||||||
|
conn->close();
|
||||||
|
}
|
||||||
|
} catch (mapnik::datasource_exception const& ex) {
|
||||||
|
// happens when borrowObject tries to
|
||||||
|
// create a new connection and fails.
|
||||||
|
// In turn, new connection would be needed
|
||||||
|
// when our broke and was thus no good to
|
||||||
|
// be borrowed
|
||||||
|
// See https://github.com/mapnik/mapnik/issues/2191
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue