Skip to content

Conversation

Atry
Copy link
Contributor

@Atry Atry commented Jan 26, 2023

100 is not enough for some slow Sonatype repository.

This PR should fix #363

100 is not enough for some slow Sonatype repository.

This PR should fix xerial#363
@xerial
Copy link
Owner

xerial commented Jan 26, 2023

Even increasing the retry limit here will not handle CircleBreakerOpenException, whose default handling is fail-fast. We need to add a further retry around making an HTTP request.

@Atry
Copy link
Contributor Author

Atry commented Jan 26, 2023

I don't understand. Shouldn't an exception be thrown from the HTTP client only after that number of retries?

@Atry
Copy link
Contributor Author

Atry commented Jan 26, 2023

Do you suggest that withMaxRetry is actually a no-op?

@xerial
Copy link
Owner

xerial commented Jan 26, 2023

The default retry logic of the HTTP client prefers fail-fast behavior and does not perform a retry when the circuit breaker opens when Sonatype is totally down https://github.com/wvlet/airframe/blob/master/airframe-http/src/main/scala/wvlet/airframe/http/HttpClientException.scala#L162

withMaxRetry is actually a no-op

Yes, when the circuit breaker is open. For other types of errors this setting is effective.

@Atry
Copy link
Contributor Author

Atry commented Jan 26, 2023

Would it help if the HTTP client instead consider 500 errors as transient and do not treat the host as totally down?

@xerial
Copy link
Owner

xerial commented Jan 26, 2023

Rather, disabling the circuit breaker at clientConfig would work like this:

      // Disables the circuit breaker, because Sonatype can be down for a long time https://github.com/xerial/sbt-sonatype/issues/363
      .noCircuitBreaker

@Atry Atry changed the title Increase max retries to 1000 Increase max retries to 1000 and disable the circuit breaker Jan 26, 2023
@xerial
Copy link
Owner

xerial commented Jan 26, 2023

1000 might be a bit long (~ 8 hours) but Sonatype is still down today, so it might be ok https://status.maven.org/

@xerial xerial merged commit b79a6af into xerial:master Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wvlet.airframe.http.HttpClientException
2 participants