RFR: 8331164: createJMHBundle.sh download jars fail when url needed to be redirected

SendaoYan syan at openjdk.org
Fri Apr 26 16:25:52 UTC 2024


On Fri, 26 Apr 2024 09:48:51 GMT, SendaoYan <syan at openjdk.org> wrote:

>> Hello @sendaoYan, who is adding the 302 redirect to that jar location and to which location is the URL being redirected to? What does `curl -v -O  <the-url>` show in the logs (please paste the textual logs instead of an image).
>
>> Hello @sendaoYan, who is adding the 302 redirect to that jar location and to which location is the URL being redirected to? What does `curl -v -O <the-url>` show in the logs (please paste the textual logs instead of an image).
> 
> Hello @jaikiran
> 
> - who is adding the 302 redirect to that jar location
> 
>     Is `server: Tengine` adding the 302 redirect? I am not sure.
> - which location is the URL being redirected to
>     It's redirected to oss URL: `https://archiva-maven-storage-prod.oss-cn-beijing.aliyuncs.com/repository/central/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar?Expires=1714128070&OSSAccessKeyId=LTAIfU51SusnnfCC&Signature=RulXVJOdnC09nHSkGmZmN5NIS98%3D`
> 
> 
> This is the full testual logs [curl.log](https://github.com/openjdk/jdk/files/15128464/curl.log).

> Thank you for those details @sendaoYan.
> 
> Adding `-L` (follow redirects) to unconditionally follow redirects doesn't look right to me. I think, one would want to know, during the build process, if any URLs that are in use (like this one) have changed their location and then decide if the build script should be updated to point to the new URL. I'll let the build team decide if this is OK to change. I don't know anything about the server (Maven mirror?) you are using that's generating this redirect, to suggest a workaround.

@jaikiran Hello
  The `maven.aliyun.com` always redirects to new OSS URL, and the OSS URL will expired in 3600 secnods, as show below:

yansendao at j66e07344:[tmp]> date +%s
1714148237
yansendao at j66e07344:[tmp]> curl -OL -v --fail https://maven.aliyun.com/repository/public/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar 2>&1 | grep '> GET'
> GET /repository/public/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar HTTP/2
> GET /repository/central/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar?Expires=1714151841&OSSAccessKeyId=LTAIfU51SusnnfCC&Signature=%2BU29N2ems10WCjO%2FhhLJm6tT6tU%3D HTTP/1.1
yansendao at j66e07344:[tmp]> curl -OL -v --fail https://maven.aliyun.com/repository/public/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar 2>&1 | grep '> GET'
> GET /repository/public/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar HTTP/2
> GET /repository/central/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar?Expires=1714151845&OSSAccessKeyId=LTAIfU51SusnnfCC&Signature=iu2IfGjRq2p2PZJ6zMg8DtqWg%2Fg%3D HTTP/1.1

  So we can't get the final URL, because it will expired in short time.
  On the other hand, the `make/devkit/createGraphvizBundle.sh` file already use `curl -L`

> grep curl make/devkit/createGraphvizBundle.sh
        curl -L -o "${file}" "${url}"

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18965#issuecomment-2079706237


More information about the build-dev mailing list