Skip to content

setupRetry() is incorrectly called twice in router::Filter::onSoftPerTryTimeout() #10211

@ggreenway

Description

@ggreenway

Through code inspection (NOT observation of any runtime behavior), I found the following snippet, which calls setupRetry() twice. The call after the conditional should probably be removed. This will cause pending_retries_ to be incremented twice here instead of once.

  // Track this as a timeout for outlier detection purposes even though we didn't
  // cancel the request yet and might get a 2xx later.
  updateOutlierDetection(Upstream::Outlier::Result::LocalOriginTimeout, upstream_request,
                         absl::optional<uint64_t>(enumToInt(timeout_response_code_)));
  upstream_request.outlier_detection_timeout_recorded_ = true;
  if (!downstream_response_started_ && retry_state_) {
    RetryStatus retry_status =
        retry_state_->shouldHedgeRetryPerTryTimeout([this]() -> void { doRetry(); });
    if (retry_status == RetryStatus::Yes && setupRetry()) {
      setupRetry();

Found here:

setupRetry();

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions