Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retry on server errror 502 #16

Open
koppor opened this issue May 17, 2024 · 6 comments
Open

Add retry on server errror 502 #16

koppor opened this issue May 17, 2024 · 6 comments

Comments

@koppor
Copy link

koppor commented May 17, 2024

In case of large projects, maven central response with 502.

See JabRef/jabref-koppor#686 for a non-MWE.

Cannot determine dependency age for "com.vladsch.flexmark:flexmark-util-html:0.64.8" and repository "MavenRepo" (reason: IOException: Response for URL https://search.maven.org/solrsearch/select?q=g%3A%22com.vladsch.flexmark%22%20AND%20a%3A%22flexmark-util-html%22 returned 502).

I think, a "simply" retry after 3 seconds should be done in the case if 502 is returned.

@f4lco
Copy link
Owner

f4lco commented May 19, 2024

Hello @koppor, thank you for your feedback. This project is accepting contributions, and your suggestion seems worthwhile. Would you feel confident implementing a retry for a status code of 502?

@koppor
Copy link
Author

koppor commented May 21, 2024

@f4lco Yeah, I feel confident. I put it on my TODO list after the (unrelated) issue openrewrite/rewrite#4054 :)

@Breefield
Copy link
Contributor

+1 to this, I'm about to introduce this.
Would folks prefer an exponential backoff retry with total timeout, or just fail the entire report if 1x 502 surfaces?

I notice the 502s are not consistent and sometimes Maven is more agro than other times.

@f4lco
Copy link
Owner

f4lco commented Mar 12, 2025

@Breefield not sure if I get the question correct, let me put my 2ct that way: I think the point is to retry the same request for the same dependency at all.
I'd assume a fixed delay ("after x seconds") is fine, because we want to mitigate the effects of an unreliable network or server.
If we wanted to get around a rate limiter, we needed to find another way to throttle the requests or cache more aggressively.

Regarding the failure mode: I think the plugin already has the failOnError switch, which we can put to use:

  • on failOnError = false, we activate "best effort mode", log the terminally failed request, and move on
  • on failOnError = true, the entire report fails when all requests for a particular dependency have failed

@koppor what do you think?

@Breefield
Copy link
Contributor

Oh yes, failOnError already exists.

This would just a be a retry policy with a retry limit.

@Breefield
Copy link
Contributor

#37

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

No branches or pull requests

3 participants