Skip to content

Commit

Permalink
Add http 429 error to auth service retry condition
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Jul 6, 2024
1 parent b0c775a commit 8282a49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import io.seqera.wave.util.StringUtils
import jakarta.inject.Inject
import jakarta.inject.Singleton
import static io.seqera.wave.WaveDefault.DOCKER_IO
import static io.seqera.wave.WaveDefault.HTTP_SERVER_ERRORS
import static io.seqera.wave.WaveDefault.HTTP_RETRYABLE_ERRORS
/**
* Implement Docker authentication & login service
*
Expand Down Expand Up @@ -116,7 +116,7 @@ class RegistryAuthServiceImpl implements RegistryAuthService {
// retry strategy
final retryable = Retryable
.<HttpResponse<String>>of(httpConfig)
.retryIf( (response) -> response.statusCode() in HTTP_SERVER_ERRORS)
.retryIf( (response) -> response.statusCode() in HTTP_RETRYABLE_ERRORS)
.onRetry((event) -> log.warn("Unable to connect '$endpoint' - event: $event}"))
// make the request
final response = retryable.apply(()-> httpClient.send(request, HttpResponse.BodyHandlers.ofString()))
Expand Down Expand Up @@ -203,7 +203,7 @@ class RegistryAuthServiceImpl implements RegistryAuthService {
// retry strategy
final retryable = Retryable
.<HttpResponse<String>>of(httpConfig)
.retryIf( (response) -> ((HttpResponse)response).statusCode() in HTTP_SERVER_ERRORS )
.retryIf( (response) -> ((HttpResponse)response).statusCode() in HTTP_RETRYABLE_ERRORS )
.onRetry((event) -> log.warn("Unable to connect '$login' - event: $event"))
// submit http request
final response = retryable.apply(()-> httpClient.send(req, HttpResponse.BodyHandlers.ofString()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import jakarta.inject.Inject
import jakarta.inject.Singleton
import static io.seqera.wave.WaveDefault.DOCKER_IO
import static io.seqera.wave.WaveDefault.DOCKER_REGISTRY_1
import static io.seqera.wave.WaveDefault.HTTP_SERVER_ERRORS
import static io.seqera.wave.WaveDefault.HTTP_RETRYABLE_ERRORS
/**
* Lookup service for container registry. The role of this component
* is to registry the retrieve the registry authentication realm
Expand Down Expand Up @@ -73,7 +73,7 @@ class RegistryLookupServiceImpl implements RegistryLookupService {
// retry strategy
final retryable = Retryable
.<HttpResponse<String>>of(httpConfig)
.retryIf((response) -> response.statusCode() in HTTP_SERVER_ERRORS)
.retryIf((response) -> response.statusCode() in HTTP_RETRYABLE_ERRORS )
.onRetry((event) -> log.warn("Unable to connect '$endpoint' - event: $event"))
// submit the request
final response = retryable.apply(()-> httpClient.send(request, HttpResponse.BodyHandlers.ofString()))
Expand Down

0 comments on commit 8282a49

Please sign in to comment.