title: Kafka consumer group keep moving to PreparingRebalance state and stops consuming
body: <p>We have a Kafka Streams consumer group that keep moving to PreparingRebalance state and stop consuming.
  The pattern is as follows:</p>
  <ol>
  <li><p>Consumer group is running and stable for around 20 minutes</p>
  </li>
  <li><p>New consumers (members) start to appear in the group state without any clear reason, these new members only originate from a small number of VMs (not the same VMs each time), and they keep joining</p>
  </li>
  <li><p>Group state changes to PreparingRebalance</p>
  </li>
  <li><p>All consumers stop consuming, showing these logs:
  &quot;Group coordinator ... is unavailable or invalid, will attempt rediscovery&quot;</p>
  </li>
  <li><p>The consumer on VMs that generated extra members show these logs:</p>
  </li>
  </ol>
  <blockquote>
  <p>Offset commit failed on partition X at offset Y: The coordinator is not aware of this member.</p>
  <p>Failed to commit stream task X since it got migrated to another thread already. Closing it as zombie before triggering a new rebalance.</p>
  <p>Detected task Z that got migrated to another thread. This implies that this thread missed a rebalance and dropped out of the consumer group. Will try to rejoin the consumer group.</p>
  </blockquote>
  <ol start="6">
  <li>We kill all consumer processes on all VMs, the group moves to Empty with 0 members, we start the processes and we're back to step 1</li>
  </ol>
  <p>Kafka version is 1.1.0, streams version is 2.0.0</p>
  <p>We took thread dumps from the misbehaving consumers, and didn't see more consumer threads than configured.</p>
  <p>We tried restarting kafka brokers, cleaning zookeeper cache.</p>
  <p>We suspect that the issue has to do with missing heartbeats, but the default heartbeat is 3 seconds and message handling times are no where near that.</p>
  <p>Anyone encountered a similar behaviour?</p>