hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huor <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request: HAWQ-252. fix a coredump when yarn he...
Date Wed, 03 Feb 2016 10:23:20 GMT
Github user huor commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/330#discussion_r51702311
  
    --- Diff: depends/libyarn/src/libyarnclient/LibYarnClient.cpp ---
    @@ -106,7 +106,7 @@ list<ResourceRequest> LibYarnClient::getAskRequests() {
     
     void* heartbeatFunc(void* args) {
    --- End diff --
    
    1. Do we need to retry here as it already retries in "client->dummyAllocate();"?
    
    2. If we need to retry, the code can be refined as below. The main points are:
    
    1) use macro instead of magic number for maximum retry number
    2) provide retry time in logging information
    3) use /* ... */ for multiple line comment
    
    {noformat}
    	#define HEARTBEAT_MAX_RETRY_NUM 2
    
    	int failcounter = 0;
    	LibYarnClient *client = (LibYarnClient*)args;
    
    	while (client->keepRun) {
    		try {
    			client->dummyAllocate();
    			failcounter = 0;
    		}
    		catch(const YarnException &e) {
    			failcounter++;
    
    			LOG(WARNING, "LibYarnClient::heartbeatFunc, dummy allocation "
    						 "is not correctly executed in try %d with exception raised. %s",
    						 failcounter;
    						 e.msg());
    
    			if ( failcounter >= HEARTBEAT_MAX_RETRY_NUM ) {
    				/**
    				 * In case retry too many times with errors/exceptions, this
    				 * thread will return. LibYarn has to re-register application
    				 * and start the heartbeat thread again.
    				 */
    				LOG(WARNING, "LibYarnClient::heartbeatFunc, there are too many "
    						     "failures raised after %d maximum retries. This heart-beat thread exits now.",
HEARTBEAT_MAX_RETRY_NUM);
    				client->keepRun = false;
    				break;
    			}
    		}
    		usleep((client->heartbeatInterval) * 1000);
    	}
    {noformat}


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message