mirror of https://github.com/citusdata/citus.git
Merge pull request #615 from citusdata/feature/purge_connections
Purge connection if re-raising error cr: @anarazelpull/574/head
commit
105f8a9132
|
@ -263,11 +263,6 @@ ReportRemoteError(PGconn *connection, PGresult *result, bool raiseError)
|
||||||
sqlStateString[3], sqlStateString[4]);
|
sqlStateString[3], sqlStateString[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (raiseError)
|
|
||||||
{
|
|
||||||
errorLevel = ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the PGresult did not contain a message, the connection may provide a
|
* If the PGresult did not contain a message, the connection may provide a
|
||||||
* suitable top level one. At worst, this is an empty string.
|
* suitable top level one. At worst, this is an empty string.
|
||||||
|
@ -286,6 +281,16 @@ ReportRemoteError(PGconn *connection, PGresult *result, bool raiseError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If requested, actually raise an error. This necessitates purging the
|
||||||
|
* connection so it doesn't remain in the hash in an invalid state.
|
||||||
|
*/
|
||||||
|
if (raiseError)
|
||||||
|
{
|
||||||
|
errorLevel = ERROR;
|
||||||
|
PurgeConnection(connection);
|
||||||
|
}
|
||||||
|
|
||||||
if (sqlState == ERRCODE_CONNECTION_FAILURE)
|
if (sqlState == ERRCODE_CONNECTION_FAILURE)
|
||||||
{
|
{
|
||||||
ereport(errorLevel, (errcode(sqlState),
|
ereport(errorLevel, (errcode(sqlState),
|
||||||
|
|
Loading…
Reference in New Issue