hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From y...@apache.org
Subject incubator-hawq git commit: HAWQ-383. Fix memory leak when testing local postmaster health
Date Tue, 02 Feb 2016 03:48:23 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 6ec1401fa -> 08baa2648


HAWQ-383. Fix memory leak when testing local postmaster health


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/08baa264
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/08baa264
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/08baa264

Branch: refs/heads/master
Commit: 08baa26487b158f4ed1aea06bd48950805b6347a
Parents: 6ec1401
Author: YI JIN <yjin@pivotal.io>
Authored: Tue Feb 2 14:34:00 2016 +1100
Committer: YI JIN <yjin@pivotal.io>
Committed: Tue Feb 2 14:34:00 2016 +1100

----------------------------------------------------------------------
 src/backend/resourcemanager/requesthandler_RMSEG.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/08baa264/src/backend/resourcemanager/requesthandler_RMSEG.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/requesthandler_RMSEG.c b/src/backend/resourcemanager/requesthandler_RMSEG.c
index 67424e9..e667c1a 100644
--- a/src/backend/resourcemanager/requesthandler_RMSEG.c
+++ b/src/backend/resourcemanager/requesthandler_RMSEG.c
@@ -300,23 +300,29 @@ bool handleRMSEGRequestRUAlive(void **arg)
 	sprintf(conninfo,
 			"options='-c gp_session_role=UTILITY' dbname=template1 port=%d connect_timeout=60",
 			seg_addr_port);
-	while (retry > 0) {
+	while (retry > 0)
+	{
 		retry--;
 		conn = PQconnectdb(conninfo);
-		if ((libpqres = PQstatus(conn)) != CONNECTION_OK) {
-			if (retry == 0) {
+		if ((libpqres = PQstatus(conn)) != CONNECTION_OK)
+		{
+			if (retry == 0)
+			{
 				elog(LOG, "Segment's postmaster is down, PQconnectdb result : %d, %s",
 						  libpqres,
 						  PQerrorMessage(conn));
 				/* Don't send IMAlive anymore */
 				DRMGlobalInstance->SendIMAlive = false;
 			}
-			else {
+			else
+			{
+				PQfinish(conn);
 				pg_usleep(500000);
 				continue;
 			}
 		}
-		else {
+		else
+		{
 			elog(DEBUG3, "Segment's postmaster is healthy.");
 			break;
 		}


Mime
View raw message