hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruyue Ma (JIRA)" <j...@apache.org>
Subject [jira] Commented: (MAPREDUCE-1555) Maybe some code of MapTask is wrong.
Date Thu, 04 Mar 2010 01:47:27 GMT

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

Ruyue Ma commented on MAPREDUCE-1555:
-------------------------------------

1.  The NullPointerException is throwed in our cluster. It causes the hang of tasktracker's
heartbeat.

2. If the HeartbeatResponse is not sent successfully,  it will resend in the next heartbeat.
The MapTask is not recreated. It uses the old MapTask object.  The code is: 

{code:title=JobTracker.java|borderStyle=solid}
  public synchronized HeartbeatResponse heartbeat(TaskTrackerStatus status, 
                                                  boolean restarted,
                                                  boolean initialContact,
                                                  boolean acceptNewTasks, 
                                                  short responseId) 
    throws IOException {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Got heartbeat from: " + status.getTrackerName() + 
                " (restarted: " + restarted + 
                " initialContact: " + initialContact + 
                " acceptNewTasks: " + acceptNewTasks + ")" +
                " with responseId: " + responseId);
    }

    // Make sure heartbeat is from a tasktracker allowed by the jobtracker.
    if (!acceptTaskTracker(status)) {
      throw new DisallowedTaskTrackerException(status);
    }

    // First check if the last heartbeat response got through
    String trackerName = status.getTrackerName();
    long now = clock.getTime();
    boolean isBlacklisted = false;
    if (restarted) {
      faultyTrackers.markTrackerHealthy(status.getHost());
    } else {
      isBlacklisted = 
        faultyTrackers.shouldAssignTasksToTracker(status.getHost(), now);
    }
    
    HeartbeatResponse prevHeartbeatResponse =
      trackerToHeartbeatResponseMap.get(trackerName);

    if (initialContact != true) {
      // If this isn't the 'initial contact' from the tasktracker,
      // there is something seriously wrong if the JobTracker has
      // no record of the 'previous heartbeat'; if so, ask the 
      // tasktracker to re-initialize itself.
      if (prevHeartbeatResponse == null) {
        // This is the first heartbeat from the old tracker to the newly 
        // started JobTracker
        
        // Jobtracker might have restarted but no recovery is needed
        // otherwise this code should not be reached
        LOG.warn("Serious problem, cannot find record of 'previous' " +
                 "heartbeat for '" + trackerName + 
                 "'; reinitializing the tasktracker");
        return new HeartbeatResponse(responseId, 
            new TaskTrackerAction[] {new ReinitTrackerAction()});
      
      } else {
                
        // It is completely safe to not process a 'duplicate' heartbeat from a 
        // {@link TaskTracker} since it resends the heartbeat when rpcs are 
        // lost see {@link TaskTracker.transmitHeartbeat()};
        // acknowledge it by re-sending the previous response to let the 
        // {@link TaskTracker} go forward. 
        if (prevHeartbeatResponse.getResponseId() != responseId) {
          LOG.info("Ignoring 'duplicate' heartbeat from '" + 
              trackerName + "'; resending the previous 'lost' response");
          return prevHeartbeatResponse;                   // HERE !!!!!!!!!!!!!!!!!
        }
      }
    }

{code} 

> Maybe some code of MapTask is wrong.
> ------------------------------------
>
>                 Key: MAPREDUCE-1555
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-1555
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: task
>            Reporter: Ruyue Ma
>
> {code:title=MapTask.java|borderStyle=solid}
>   public void write(DataOutput out) throws IOException {
>     super.write(out);
>     if (isMapOrReduce()) {
>       splitMetaInfo.write(out);
>       splitMetaInfo = null;  // HERE:  why set null ??????
>     }
>   }
> {code} 
> In above code, if the splitMetaInfo is set null, Second Serialization (will invoke write)
will throw NullPointerException. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message