mirror of https://github.com/citusdata/citus.git
Cancel statements when closing connection at transaction end.
That's important because the currently running statement on a worker might continue to hold locks and consume resources, even after the connection is closed. Unfortunately postgres will only notice closed connections when reading from / writing to the network. That might only happen much later.pull/1473/head
parent
be8677f926
commit
0d791f6740
|
@ -718,8 +718,7 @@ AfterXactHostConnectionHandling(ConnectionHashEntry *entry, bool isCommit)
|
||||||
PQstatus(connection->pgConn) != CONNECTION_OK ||
|
PQstatus(connection->pgConn) != CONNECTION_OK ||
|
||||||
PQtransactionStatus(connection->pgConn) != PQTRANS_IDLE)
|
PQtransactionStatus(connection->pgConn) != PQTRANS_IDLE)
|
||||||
{
|
{
|
||||||
PQfinish(connection->pgConn);
|
ShutdownConnection(connection);
|
||||||
connection->pgConn = NULL;
|
|
||||||
|
|
||||||
/* unlink from list */
|
/* unlink from list */
|
||||||
dlist_delete(iter.cur);
|
dlist_delete(iter.cur);
|
||||||
|
|
Loading…
Reference in New Issue