if (!status.getHealthStatus().isNodeHealthy()) {
@Override public void run() { if (MesosTracker.this.active) { // If the tracker activated while we were awaiting to acquire the // lock, start the periodic cleanup timer and return. schedulePeriodic(); return; } // When the scheduler is busy or doesn't receive offers, it may // fail to mark some TaskTrackers as active even though they are. // Here we do a final check with the JobTracker to make sure this // TaskTracker is really not there before we kill it. final Collection<TaskTrackerStatus> taskTrackers = MesosTracker.this.scheduler.jobTracker.taskTrackers(); for (TaskTrackerStatus status : taskTrackers) { HttpHost host = new HttpHost(status.getHost(), status.getHttpPort()); if (status.getHealthStatus().isNodeHealthy() && MesosTracker.this.host.equals(host)) { schedulePeriodic(); return; } } if (MesosTracker.this.scheduler.metrics != null) { MesosTracker.this.scheduler.metrics.launchTimeout.mark(); } LOG.warn("Tracker " + MesosTracker.this.host + " failed to launch within " + MesosScheduler.LAUNCH_TIMEOUT_MS / 1000 + " seconds, killing it"); MesosTracker.this.scheduler.killTracker(MesosTracker.this); } }, MesosScheduler.LAUNCH_TIMEOUT_MS, TimeUnit.MILLISECONDS);
TaskTrackerStatus tt = (TaskTrackerStatus) it.next(); long sinceHeartbeat = System.currentTimeMillis() - tt.getLastSeen(); boolean isHealthy = tt.getHealthStatus().isNodeHealthy(); long sinceHealthCheck = tt.getHealthStatus().getLastReported(); String healthString = "";
.isNodeHealthy()); assertTrue("Node health status reported unhealthy", healthStatus .getHealthReport().isEmpty()); LOG.info("Checking Healthy--->Unhealthy"); assertFalse("Node health status reported healthy", healthStatus .isNodeHealthy()); assertFalse("Node health status reported healthy", healthStatus .getHealthReport().isEmpty()); .isNodeHealthy()); assertTrue("Node health status reported unhealthy", healthStatus .getHealthReport().isEmpty()); LOG.info("Checking Healthy--->timeout"); assertFalse("Node health status reported healthy even after timeout", healthStatus.isNodeHealthy()); assertEquals("Node time out message not propogated", healthStatus .getHealthReport(),
private static void sendHeartBeat(TaskTrackerHealthStatus status, boolean initialContact) throws IOException { for (String tracker : trackers) { TaskTrackerStatus tts = new TaskTrackerStatus(tracker, JobInProgress .convertTrackerNameToHostName(tracker)); if (status != null) { TaskTrackerHealthStatus healthStatus = tts.getHealthStatus(); healthStatus.setNodeHealthy(status.isNodeHealthy()); healthStatus.setHealthReport(status.getHealthReport()); healthStatus.setLastReported(status.getLastReported()); } jobTracker.heartbeat(tts, false, initialContact, false, responseId); } responseId++; }
private void updateNodeHealthStatus(TaskTrackerStatus trackerStatus) { TaskTrackerHealthStatus status = trackerStatus.getHealthStatus(); synchronized (faultyTrackers) { faultyTrackers.setNodeHealthStatus(trackerStatus.getHost(), status.isNodeHealthy(), status.getHealthReport()); } }
private void updateNodeHealthStatus(TaskTrackerStatus trackerStatus) { TaskTrackerHealthStatus status = trackerStatus.getHealthStatus(); synchronized (faultyTrackers) { faultyTrackers.setNodeHealthStatus(trackerStatus.getHost(), status.isNodeHealthy(), status.getHealthReport()); } }