[ 
https://issues.apache.org/jira/browse/MAPREDUCE-4478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422022#comment-13422022
 ] 

Liyin Liang commented on MAPREDUCE-4478:
----------------------------------------

There are two configuration items to control the TaskTracker's heartbeat 
interval. One is *mapreduce.tasktracker.outofband.heartbeat*. The other is 
*mapreduce.tasktracker.outofband.heartbeat.damper*. If we set 
*mapreduce.tasktracker.outofband.heartbeat* with true and set 
*mapreduce.tasktracker.outofband.heartbeat.damper* with default value 
(1000000), TaskTracker may send heartbeat without any interval.

The code to control heartbeat interval is as follows:
{code:java}
long now = System.currentTimeMillis();
        
        // accelerate to account for multiple finished tasks up-front
        long remaining = 
          (lastHeartbeat + getHeartbeatInterval(finishedCount.get())) - now;
        while (remaining > 0) {
          // sleeps for the wait time or 
          // until there are *enough* empty slots to schedule tasks
          synchronized (finishedCount) {
            finishedCount.wait(remaining);
            
            // Recompute
            now = System.currentTimeMillis();
            remaining = 
              (lastHeartbeat + getHeartbeatInterval(finishedCount.get())) - now;
            
            if (remaining <= 0) {
              // Reset count 
              finishedCount.set(0);
              break;
            }
          }
        }
{code}

During the first time computing, if *finishedCount* is more than zero, 
*getHeartbeatInterval(finishedCount.get())* will return zero. Then *remaining* 
will be less than or equal with zero. In this case, the *while* loop will be 
skipped. So *finishedCount* will never be set with zero.

                
> TaskTracker's heartbeat is out of control
> -----------------------------------------
>
>                 Key: MAPREDUCE-4478
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4478
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>    Affects Versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3
>            Reporter: Liyin Liang
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to