You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by wl...@apache.org on 2016/01/14 03:46:26 UTC

incubator-hawq git commit: HAWQ-272. Quit resource manager process on segment if postmaster is not alive

Repository: incubator-hawq
Updated Branches:
  refs/heads/master 3f52cbd8b -> 0827c7c78


HAWQ-272. Quit resource manager process on segment if postmaster is not alive


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

Branch: refs/heads/master
Commit: 0827c7c78986af4f95b7e3ff16cf9ad402063da8
Parents: 3f52cbd
Author: Wen Lin <wl...@pivotal.io>
Authored: Thu Jan 14 10:45:51 2016 +0800
Committer: Wen Lin <wl...@pivotal.io>
Committed: Thu Jan 14 10:45:51 2016 +0800

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


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0827c7c7/src/backend/resourcemanager/resourcemanager_RMSEG.c
----------------------------------------------------------------------
diff --git a/src/backend/resourcemanager/resourcemanager_RMSEG.c b/src/backend/resourcemanager/resourcemanager_RMSEG.c
index 893dd67..966bc7c 100644
--- a/src/backend/resourcemanager/resourcemanager_RMSEG.c
+++ b/src/backend/resourcemanager/resourcemanager_RMSEG.c
@@ -160,6 +160,12 @@ int MainHandlerLoop_RMSEG(void)
 
 	while( DRMGlobalInstance->ResManagerMainKeepRun ) {
 
+		if (!PostmasterIsAlive(true)) {
+			DRMGlobalInstance->ResManagerMainKeepRun = false;
+			elog(LOG, "Postmaster is not alive, resource manager exits");
+			break;
+		}
+
 		/* PART1. Handle socket server inputs. */
 		res = processAllCommFileDescs();
 		if ( res != FUNC_RETURN_OK ) {