boolean shuttingDown() {
            return controlledShutdownOffset >= 0;
        }
Returns true only if the broker is in controlled shutdown state.
metadata/src/main/java/org/apache/kafka/controller/BrokerHeartbeatManager.java