title: Flink TaskManager not reconnecting to the new Jobmanager
body: <p>I have configured Flink in HA mode as mentioned <a href="https://ci.apache.org/projects/flink/flink-docs-release-1.5/ops/jobmanager_high_availability.html" rel="nofollow noreferrer">here</a>:</p>
  
  <p>I wanted to test the fault tolerance, hence I did the following:</p>
  
  <ol>
  <li>Setup Flink cluster with 2 JobManagers and 1 TaskManager</li>
  <li>Start a streaming job on task manager</li>
  <li>Kill the active job manager(to simulate a crash)</li>
  <li>The leader election is happening as expected.</li>
  <li>But the task manager is noted reconnecting to the new job manager. It simply tries to reconnect to the previous leader every 10seconds.</li>
  </ol>
  
  <p>Pasting the task manager log here:</p>
  
  <pre><code>2018-07-25 19:46:08,508 INFO  org.apache.flink.runtime.taskexecutor.TaskManagerConfiguration  - Messages have a max timeout of 10000 ms
  2018-07-25 19:46:08,515 INFO  org.apache.flink.runtime.rpc.akka.AkkaRpcService              - Starting RPC endpoint for org.apache.flink.runtime.taskexecutor.TaskExecutor at akka://flink/user/taskmanager_0 .
  2018-07-25 19:46:08,524 INFO  org.apache.flink.runtime.leaderretrieval.ZooKeeperLeaderRetrievalService  - Starting ZooKeeperLeaderRetrievalService /leader/resource_manager_lock.
  2018-07-25 19:46:08,525 INFO  org.apache.flink.runtime.taskexecutor.JobLeaderService        - Start job leader service.
  2018-07-25 19:46:08,529 INFO  org.apache.flink.runtime.taskexecutor.TaskExecutor            - Connecting to ResourceManager akka.tcp://flink@10.10.97.210:46477/user/resourcemanager(b91b9aeb3565be973c9bb47259414e0a).
  2018-07-25 19:46:08,574 WARN  akka.remote.transport.netty.NettyTransport                    - Remote connection to [null] failed with java.net.ConnectException: Connection refused: /10.10.97.210:46477
  2018-07-25 19:46:08,576 WARN  akka.remote.ReliableDeliverySupervisor                        - Association with remote system [akka.tcp://flink@10.10.97.210:46477] has failed, address is now gated for [50] ms. Reason: [Association failed with [akka.tcp://flink@10.10.97.210:46477]] Caused by: [Connection refused: /10.10.97.210:46477]
  2018-07-25 19:46:08,579 INFO  org.apache.flink.runtime.taskexecutor.TaskExecutor            - Could not resolve ResourceManager address akka.tcp://flink@10.10.97.210:46477/user/resourcemanager, retrying in 10000 ms: Could not connect to rpc endpoint under address akka.tcp://flink@10.10.97.210:46477/user/resourcemanager..
  2018-07-25 19:46:18,606 WARN  akka.remote.transport.netty.NettyTransport                    - Remote connection to [null] failed with java.net.ConnectException: Connection refused: /10.10.97.210:46477
  2018-07-25 19:46:18,607 WARN  akka.remote.ReliableDeliverySupervisor                        - Association with remote system [akka.tcp://flink@10.10.97.210:46477] has failed, address is now gated for [50] ms. Reason: [Association failed with [akka.tcp://flink@10.10.97.210:46477]] Caused by: [Connection refused: /10.10.97.210:46477]
  2018-07-25 19:46:18,607 INFO  org.apache.flink.runtime.taskexecutor.TaskExecutor            - Could not resolve ResourceManager address akka.tcp://flink@10.10.97.210:46477/user/resourcemanager, retrying in 10000 ms: Could not connect to rpc endpoint under address akka.tcp://flink@10.10.97.210:46477/user/resourcemanager..
  </code></pre>
  
  <ol>
  <li>Restarting task manager doesn't help</li>
  <li>Restarting cluster doesn't help</li>
  </ol>
  
  <p>Please guide me if anything is missing.</p>