def critical?(replicas: 1)
      result, mutex = false, Mutex.new
      threads = replicated_partitions.map do |partition|
        Thread.new do
          Thread.abort_on_exception = true
          isr = partition.isr.reject { |r| r == self }
          mutex.synchronize { result = true if isr.length < Integer(replicas) }
        end
      end
      threads.each(&:join)
      result
    end
def critical?(replicas: 1)
      result, mutex = false, Mutex.new
      threads = replicated_partitions.map do |partition|
        Thread.new do
          Thread.abort_on_exception = true
          isr = partition.isr.reject { |r| r == self }
          mutex.synchronize { result = true if isr.length < Integer(replicas) }
        end
      end
      threads.each(&:join)
      result
    end
Returns whether this broker is currently considered critical.

 A broker is considered critical if it is the only in sync replica
 of any of the partitions it hosts. This means that if this broker
 were to go down, the partition woild become unavailable for writes,
 and may also lose data depending on the configuration and settings.