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-678. Resource manager should close connection with QD when QD is cancelled and try to return resource to clean up all registered resource context
Date Fri, 15 Apr 2016 01:48:05 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 14359278d -> 856991354


HAWQ-678. Resource manager should close connection with QD when QD is cancelled and try to
return resource to clean up all registered resource context


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

Branch: refs/heads/master
Commit: 8569913548b37498d36a008f17267e30b0de9558
Parents: 1435927
Author: YI JIN <yjin@pivotal.io>
Authored: Fri Apr 15 11:47:54 2016 +1000
Committer: YI JIN <yjin@pivotal.io>
Committed: Fri Apr 15 11:47:54 2016 +1000

----------------------------------------------------------------------
 src/backend/resourcemanager/conntrack.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/85699135/src/backend/resourcemanager/conntrack.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/conntrack.c b/src/backend/resourcemanager/conntrack.c
index 2babef4..c5b0fbf 100644
--- a/src/backend/resourcemanager/conntrack.c
+++ b/src/backend/resourcemanager/conntrack.c
@@ -264,6 +264,23 @@ int retrieveConnectionTrack(ConnectionTrack track, int32_t connid)
 
 	Assert( oldct != NULL );
 
+	/*
+	 * If the old connection track has an active connection, close it and cut
+	 * its relation with comm buffer.
+	 */
+	if ( oldct->CommBuffer != NULL )
+	{
+		AsyncCommBuffer 				commbuffer  = oldct->CommBuffer;
+		AsyncCommMessageHandlerContext 	context 	= commbuffer->UserData;
+		elog(WARNING, "Uncompleted resource negotiation is found, force FD %d "
+					  "closed.",
+					  commbuffer->FD);
+		/* Cut the reference between connection track and rmcomm buffer. */
+		oldct->CommBuffer = NULL;
+		context->UserData = NULL;
+		forceCloseFileDesc(commbuffer);
+	}
+
 	track->ConnID   				= oldct->ConnID;
 	track->Progress 				= oldct->Progress;
 	track->QueueID  				= oldct->QueueID;


Mime
View raw message