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

JDK-8299627: Fix/improve handling of "missing" element-list file #16751

Closed

Conversation

jonathan-gibbons
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons commented Nov 20, 2023

Please review a relatively simple fix to work around weirdly configured web servers.

As first reported in this email, https://mail.openjdk.org/pipermail/javadoc-dev/2023-January/005502.html
docs.oracle.com will redirect links to https://docs.oracle.com/javase/8/docs/api/element-list to https://docs.oracle.com/en/java/javase/19/ even though the content of the page is completely different, and not as expected.
It was true back when the email discussion happened, and it is still true today (November 20, 2023).

For more details: see this:

$ curl --head https://docs.oracle.com/javase/8/docs/api/element-list
HTTP/1.1 302 Moved Temporarily
Location: https://docs.oracle.com/en/java/javase/21/
Content-Length: 1
Date: Mon, 20 Nov 2023 23:17:27 GMT
Connection: keep-alive

Compare this to accessing package-list

$ curl --head https://docs.oracle.com/javase/8/docs/api/package-list
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Type: text/plain
ETag: "a8e824353743394b56c8af52dce037a1:1697560290.919784"
Last-Modified: Wed, 04 Oct 2023 08:27:21 GMT
Server: AkamaiNetStorage
Content-Length: 4366
Date: Mon, 20 Nov 2023 23:20:35 GMT
Connection: keep-alive

In other words, we're getting 302 Moved Temporarily instead of 404 Not Found. Sigh.

So, with that as background, the fix is to check the end of the redirected URL against the end of the desired URL. to make sure they agree. In other words, we check that both end in package-list or element-list as appropriate.

The fix to the main code is almost trivial. The test is almost noreg-hard and primarily consists of setting up a weirdly configured local web server, to exercise different redirect policies.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8299627: Fix/improve handling of "missing" element-list file (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16751/head:pull/16751
$ git checkout pull/16751

Update a local copy of the PR:
$ git checkout pull/16751
$ git pull https://git.openjdk.org/jdk.git pull/16751/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16751

View PR using the GUI difftool:
$ git pr show -t 16751

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16751.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 20, 2023

👋 Welcome back jjg! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 20, 2023
@openjdk
Copy link

openjdk bot commented Nov 20, 2023

@jonathan-gibbons The following label will be automatically applied to this pull request:

  • javadoc

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the javadoc javadoc-dev@openjdk.org label Nov 20, 2023
@mlbridge
Copy link

mlbridge bot commented Nov 20, 2023

Webrevs

Copy link
Member

@hns hns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Kudos for taking it upon yourself to write the test.

@openjdk
Copy link

openjdk bot commented Dec 7, 2023

@jonathan-gibbons This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8299627: Fix/improve handling of "missing" element-list file

Reviewed-by: hannesw

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 280 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 7, 2023
@bridgekeeper
Copy link

bridgekeeper bot commented Jan 5, 2024

@jonathan-gibbons This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@jonathan-gibbons
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 16, 2024

Going to push as commit b533272.
Since your change was applied there have been 648 commits pushed to the master branch:

  • 1007618: 8323731: Unproblemlist gc/stress/TestStressG1Humongous.java
  • 790871e: 8323800: Serial: Fix include guard macro in generation.hpp
  • 0216f5d: 8323730: Tweak TestZAllocationStallEvent.java to allocate smaller objects
  • 21f6473: 8322675: JFR: Fail-fast mode when constants cannot be resolved
  • e2d6023: 8323631: JfrTypeSet::write_klass can enqueue a CLD klass that is unloading
  • 2fd775f: 8323651: compiler/c2/irTests/TestPrunedExHandler.java fails with -XX:+DeoptimizeALot
  • ee4d9aa: 8323659: LinkedTransferQueue add and put methods call overridable offer
  • 5045839: 8323635: Test gc/g1/TestHumongousAllocConcurrentStart.java fails with -XX:TieredStopAtLevel=3
  • 44a9392: 8323780: Serial: Remove unused _full_collections_completed
  • 5906240: 8323716: Only print ZGC Phase Switch events in hs_err files when running with ZGC
  • ... and 638 more: https://git.openjdk.org/jdk/compare/30d895383eda37ba1475825a258feb0a15da1526...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 16, 2024
@openjdk openjdk bot closed this Jan 16, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 16, 2024
@openjdk
Copy link

openjdk bot commented Jan 16, 2024

@jonathan-gibbons Pushed as commit b533272.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated javadoc javadoc-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

2 participants