title: What could cause "Failed to get offsets by times" in a Kafka Consumer?
body: <p>I have a Kafka consumer. It seems to work for a while, and then die. It does this repeatedly. I get this exception but no other information.</p>
  
  <pre><code>org.apache.kafka.common.errors.TimeoutException:
  Failed to get offsets by times in 305000 ms
  </code></pre>
  
  <p>305000 ms is 5 minutes. Is there any clue about what might cause this? Or steps to try and find out?</p>
  
  <p>In case it's relevant:</p>
  
  <p>I have 3 processes on different machines, using the latest Java Kafka Client version 0.10.2.0. Each machine is running 20 threads, each thread has a separate Consumer. By design, when one thread dies, all threads are killed and the process dies, and are restarted. This leads to ~20 consumers simultaneously dying and restarting, which will lead to a rebalance. So it's possible that this may cause a periodic interference between the clients. This doesn't explain why I get this exception in the first place, however.</p>
  
  <p>I have three Kafka machines and three Zookeeper machines. Each client has all 3 Kafka machines in its <code>bootstrap.servers</code> configuration. The topic has 200 partitions, meaning that each thread is assigned approx 3 partitions. The topic has a replication factor of 2.</p>
  
  <p>There are no errors in the Kafka or Zookeeper logs.</p>
  
  <p>The following config values are set, no others.</p>
  
  <ul>
  <li>bootstrap.servers</li>
  <li>group.id</li>
  <li>key.deserializer</li>
  <li>value.deserializer</li>
  </ul>