private synchronized void startHeartbeatThreadIfNeeded() {
        if (heartbeatThread == null) {
            heartbeatThread = new HeartbeatThread();
            heartbeatThread.start();
        }
    }
Ensure the group is active (i.e., joined and synced)

@param timer Timer bounding how long this method can block
@throws KafkaException if the callback throws exception
@return true iff the group is active
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java