code: @Override
    public void run() {
      try {
        startCleanupThreads();
        try {
          while (running && !shuttingDown) {
            try {
              heartbeatToClusterManager();
            } catch (IOException e) {
              LOG.error("Error initializing heartbeat to Cluster Manager", e);
              try {
                Thread.sleep(5000L);
              } catch (InterruptedException ie) {
              }
            }
            if (shuttingDown) {
              return;
            }
          }
        } finally {
          shutdown();
        }
      } catch (IOException iex) {
        LOG.error("Got fatal exception while initializing TaskTracker", iex);
        return;
      }
    }
docs: The server retry loop.
  This while-loop attempts to connect to the JobTracker.