    def refresh
      info = command "admin", ismaster: 1

      @refreshed_at = Time.now
      primary = true if info["ismaster"]
      secondary = true if info["secondary"]

      peers = []
      peers.push info["primary"] if info["primary"]
      peers.concat info["hosts"] if info["hosts"]
      peers.concat info["passives"] if info["passives"]
      peers.concat info["arbiters"] if info["arbiters"]

      @peers = peers.map { |peer| Node.new(peer) }
      @primary, @secondary = primary, secondary

      if !primary && Threaded.executing?(:ensure_primary)
        raise Errors::ReplicaSetReconfigured, "#{inspect} is no longer the primary node."
      end
    end
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.