Repository: envoyproxy/envoy
File: envoy/upstream/upstream.h (C/C++)

Code before:
   */
  template <class Derived>
  std::shared_ptr<const Derived> extensionProtocolOptionsTyped(const std::string& name) const {
    return std::dynamic_pointer_cast<const Derived>(extensionProtocolOptions(name));
  }

  /**
   * @return OptRef<const LoadBalancerConfig> the validated load balancing policy configuration to
   * use for this cluster.
   */
  virtual OptRef<const LoadBalancerConfig> loadBalancerConfig() const PURE;

  /**
   * @return the load balancer factory for this cluster. Cluster will always has a valid load
   * balancer factory if it is created successfully.
   */
  virtual TypedLoadBalancerFactory& loadBalancerFactory() const PURE;

  /**
   * @return const envoy::config::cluster::v3::Cluster::CommonLbConfig& the common configuration for
   * all load balancers for this cluster.
   */
  virtual const envoy::config::cluster::v3::Cluster::CommonLbConfig& lbConfig() const PURE;

  virtual absl::optional<uint64_t>
  processHttpForOutlierDetection(Http::ResponseHeaderMap& reponse) const PURE;

  /**
   * @return the service discovery type to use for resolving the cluster.
   */
  virtual envoy::config::cluster::v3::Cluster::DiscoveryType type() const PURE;

  /**
   * @return the type of cluster, only used for custom discovery types.
   */
  virtual OptRef<const envoy::config::cluster::v3::Cluster::CustomClusterType>
  clusterType() const PURE;

  /**
   * @return const absl::optional<envoy::config::core::v3::TypedExtensionConfig>& the configuration
   *         for the upstream, if a custom upstream is configured.
   */
  virtual OptRef<const envoy::config::core::v3::TypedExtensionConfig> upstreamConfig() const PURE;

  /**
   * @return Whether the cluster is currently in maintenance mode and should not be routed to.
   *         Different filters may handle this situation in different ways. The implementation
   *         of this routine is typically based on randomness and may not return the same answer
   *         on each call.
   */
  virtual bool maintenanceMode() const PURE;

Review comment (bug):
```suggestion
  virtual absl::optional<bool>
  checkFailureResponse(Http::ResponseHeaderMap& reponse) const PURE;
```

return an `absl::optional<bool>` make more sense. It's unecessary to return http code.

Code after:
   */
  virtual OptRef<const LoadBalancerConfig> loadBalancerConfig() const PURE;

  /**
   * @return the load balancer factory for this cluster. Cluster will always has a valid load
   * balancer factory if it is created successfully.
   */
  virtual TypedLoadBalancerFactory& loadBalancerFactory() const PURE;

  /**
   * @return const envoy::config::cluster::v3::Cluster::CommonLbConfig& the common configuration for
   * all load balancers for this cluster.
   */
  virtual const envoy::config::cluster::v3::Cluster::CommonLbConfig& lbConfig() const PURE;

  /**
   * @param response Http::ResponseHeaderMap response headers received from upstream
   * @return absl::optional<bool> absl::nullopt is returned when matching did not took place.
   *         Otherwise, the boolean value indicates the matching result. True indicates that
   *         response should be treated as error, False as success.
   */
  virtual absl::optional<bool>
  processHttpForOutlierDetection(Http::ResponseHeaderMap& response) const PURE;

  /**
   * @return the service discovery type to use for resolving the cluster.
   */
  virtual envoy::config::cluster::v3::Cluster::DiscoveryType type() const PURE;

  /**
   * @return the type of cluster, only used for custom discovery types.
   */
  virtual OptRef<const envoy::config::cluster::v3::Cluster::CustomClusterType>
  clusterType() const PURE;

  /**
   * @return const absl::optional<envoy::config::core::v3::TypedExtensionConfig>& the configuration
   *         for the upstream, if a custom upstream is configured.
   */
  virtual OptRef<const envoy::config::core::v3::TypedExtensionConfig> upstreamConfig() const PURE;

  /**
   * @return Whether the cluster is currently in maintenance mode and should not be routed to.
   *         Different filters may handle this situation in different ways. The implementation
   *         of this routine is typically based on randomness and may not return the same answer
   *         on each call.
   */
  virtual bool maintenanceMode() const PURE;

  /**
   * @return uint32_t the maximum number of outbound requests that a connection pool will make on