hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lil...@apache.org
Subject incubator-hawq git commit: HAWQ-559. Fix QD hang when QE is immediately killed after created
Date Mon, 21 Mar 2016 01:53:45 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 6e88cbabf -> 0bb22dce1


HAWQ-559. Fix QD hang when QE is immediately killed after created


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

Branch: refs/heads/master
Commit: 0bb22dce146cbd34507293b32f5603a6dc706aec
Parents: 6e88cba
Author: Lili Ma <ictmalili@gmail.com>
Authored: Fri Mar 18 16:49:06 2016 +0800
Committer: Lili Ma <ictmalili@gmail.com>
Committed: Mon Mar 21 09:49:06 2016 +0800

----------------------------------------------------------------------
 src/backend/cdb/dispatcher.c  |  2 ++
 src/backend/cdb/executormgr.c | 20 +++++++++++++++-----
 2 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0bb22dce/src/backend/cdb/dispatcher.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/dispatcher.c b/src/backend/cdb/dispatcher.c
index 5d7105c..55a7823 100644
--- a/src/backend/cdb/dispatcher.c
+++ b/src/backend/cdb/dispatcher.c
@@ -1240,6 +1240,8 @@ dispatch_run(DispatchData *data)
 	 * Only after we have the executors, we can serialize the state. Or we
 	 * don't know the executor listening address.
 	 */
+	CHECK_FOR_INTERRUPTS();
+
 	dispatcher_serialize_state(data);
 	dispatcher_serialize_query_resource(data);
 	dispatcher_set_state_run(data);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0bb22dce/src/backend/cdb/executormgr.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/executormgr.c b/src/backend/cdb/executormgr.c
index 47f5bbe..2bc5059 100644
--- a/src/backend/cdb/executormgr.c
+++ b/src/backend/cdb/executormgr.c
@@ -364,7 +364,19 @@ executormgr_validate_conn(PGconn *conn)
 {
   if (conn == NULL)
     return false;
-  return dispatch_validate_conn(conn->sock);
+  if (!dispatch_validate_conn(conn->sock))
+  {
+    printfPQExpBuffer(&conn->errorMessage,
+              libpq_gettext(
+                  "server closed the connection unexpectedly\n"
+             "\tThis probably means the server terminated abnormally\n"
+                 "\tbefore or while processing the request.\n"));
+    conn->status = CONNECTION_BAD;
+    closesocket(conn->sock);
+    conn->sock = -1;
+    return false;
+  }
+  return true;
 }
 
 /*
@@ -408,7 +420,7 @@ executormgr_dispatch_and_run(struct DispatchData *data, QueryExecutor
*executor)
 	DispatchCommandQueryParms	*parms = dispatcher_get_QueryParms(data);
 
 	if (!executormgr_is_dispatchable(executor))
-		return false;
+	  goto error;
 
 	TIMING_BEGIN(executor->time_dispatch_begin);
 	query = PQbuildGpQueryString(parms->strCommand, parms->strCommandlen,
@@ -573,10 +585,8 @@ executormgr_catch_error(QueryExecutor *executor)
 
 	msg = PQerrorMessage(conn);
 
-	if (msg && (strcmp("", msg) != 0) && (executor->refResult->errcode
== 0)){
+	if (msg && (strcmp("", msg) != 0) && (executor->refResult->errcode
== 0)) {
 	  errCode = ERRCODE_GP_INTERCONNECTION_ERROR;
-	  if (errCode == ERRCODE_GP_INTERCONNECTION_ERROR)
-	    errCode = ERRCODE_GP_INTERCONNECTION_ERROR;
 	}
 
 	PQExpBufferData selfDesc;


Mime
View raw message