From b240854b8c474d6d84be3ac6fba5617cefb97048 Mon Sep 17 00:00:00 2001 From: Hadi Moshayedi Date: Tue, 18 Jun 2019 11:57:33 +0200 Subject: [PATCH] Use SendCancelationRequest() in ShutdownConnection() --- .../distributed/connection/connection_management.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/backend/distributed/connection/connection_management.c b/src/backend/distributed/connection/connection_management.c index 47809da8e..a7ae7d8d0 100644 --- a/src/backend/distributed/connection/connection_management.c +++ b/src/backend/distributed/connection/connection_management.c @@ -456,15 +456,7 @@ ShutdownConnection(MultiConnection *connection) if (PQstatus(connection->pgConn) == CONNECTION_OK && PQtransactionStatus(connection->pgConn) == PQTRANS_ACTIVE) { - char errorMessage[ERROR_BUFFER_SIZE] = { 0 }; - PGcancel *cancel = PQgetCancel(connection->pgConn); - - if (!PQcancel(cancel, errorMessage, sizeof(errorMessage))) - { - ereport(WARNING, (errmsg("could not cancel connection: %s", - errorMessage))); - } - PQfreeCancel(cancel); + SendCancelationRequest(connection); } PQfinish(connection->pgConn); connection->pgConn = NULL;