-
Notifications
You must be signed in to change notification settings - Fork 15
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
Repository redirects cause tiny-maven-proxy to hang #10
Comments
@mbafford I'm also seeing this issue. Did you figure anything out? In general it would be nice to set a timeout. Maybe that can be done by putting a proxy like nginx in front of this and set the timeout there. |
@alexklibisz Off-topic for this issue, so I'll keep it brief here (more comments at the link below). I found it easier to scratch my itch by writing a quick Python script (https://gist.github.com/mbafford/d25939a35f5066d46753db6bfba7684b) to do the mirroring from my local |
Neat, thanks. We ended up going in a different direction. We set up a virtual repository in JFrog to merge all of our internal and external repos, deployed an nginx reverse proxy with caching in our cluster so that it proxied requests out to Jfrog, and pointed our builds at the nginx server. I did experiment with a pure nginx reverse proxy solution but it turns out to be very difficult to handle all of the response codes and possible errors with the different artifact repos. |
I am also seeing this issue with a 303. curl -v https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom *snip* > GET /m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom HTTP/1.1 > Host: plugins.gradle.org > User-Agent: curl/7.64.1 > Accept: */* > < HTTP/1.1 303 See Other < Date: Fri, 28 Jan 2022 23:39:44 GMT < Content-Length: 0 < Connection: keep-alive < Location: https://plugins-artifacts.gradle.org/org.jlleitschuh.gradle/ktlint-gradle/9.4.1/86fac77c64e4229194669cde401e08c5fa4defd88a4fd3e05deff35b2d977a22/ktlint-gradle-9.4.1.pom *snip*
defer and download org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom attempt https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Connecting https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Connected https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state SendRequest https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state AwaitingResponse https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Redirect https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Connecting https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom Complete w/ remaining 1 state Cancelled https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom defer and download org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom attempt https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Connecting https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Connected https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state SendRequest https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state AwaitingResponse https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Redirect https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Connecting https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom Complete w/ remaining 1 state Cancelled https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom defer and download org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom attempt https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Connecting https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Connected https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state SendRequest https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state AwaitingResponse https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Redirect https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom state Connecting https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom Complete w/ remaining 1 state Cancelled https://plugins.gradle.org/m2/org/jlleitschuh/gradle/ktlint-gradle/9.4.1/ktlint-gradle-9.4.1.pom |
It looks like tiny-maven-proxy has a bug which causes the request to hang for 30+ minutes (indefinitely?) when the repository returns a 301/302 redirect.
Using the latest JAR build linked from this repository:
Called with
curl
:Logs for those 34 minutes:
And then after killing the
curl
process:The URL being fetched ( https://oss.sonatype.org/content/repositories/releases/BAD.jar ) returns a
302
redirect very quickly when called directly with curl:This seems to be related to the repository returning a redirect. I can reproduce with
https://repo1.maven.org/content/repositories/releases/
, which301
redirects tohttps://repo1.maven.org/maven2/BAD.jar
in the above test.However, a repository which doesn't do redirects fails quickly:
The text was updated successfully, but these errors were encountered: