-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8305763 : Parsing a URI with an underscore goes through a silent exception, negatively impacting performance #13430
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
Conversation
…atively impacting performance
|
👋 Welcome back dhanalla! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
From a quick look at the proposed change, I got the feeling that this change might not be appropriate: I suspect it will let Is this still the case after your proposed changes? |
|
Thanks for reviewing @dfuch, jshell> new URI("http://foo_bar:8080/").getHost() I will work on addressing this to keep the old behavior unchanged. |
Please make sure to run the java/net/URI tests - and when these are successful, tier1, tier2 and tier3. |
|
Thanks @dfuch,
|
dfuch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have given this a round of testing and I believe the logic is now right.
I'd suggest adding curly braces around else blocks in case of nested if statements though (see suggestion below) as it makes it easier to verify which belongs to which.
dfuch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@dhanalla 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: 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 833 new commits pushed to the
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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dfuch) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
@dhanalla if you integrate this change I will sponsor it. Alternatively if you'd prefer to wait until after the fork that's fine by me. |
|
/integrate |
|
@dfuch, Thank you for review and sponsorship. |
|
/sponsor |
|
Going to push as commit 749d480.
Your commit was automatically rebased without conflicts. |
|
/backport jdk17u-dev |
|
@dhanalla To use the |
|
/backport jdk17u-dev |
|
@dhanalla the backport was successfully created on the branch dhanalla-backport-749d4801 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link: The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:
If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev: |
Issue 8305763 : Using underscores in the name for a URI triggers a silent exception in the java standard library, which consumes 5% of the CPU.
Exception:
java.net.URISyntaxException: Illegal character in hostname at index N: xyz1_abcd.com
at java.base/java.net.URI$Parser.fail(URI.java:2943)
at java.base/java.net.URI$Parser.parseHostname(URI.java:3487)
at java.base/java.net.URI$Parser.parseServer(URI.java:3329)
We can see that if parseServer fails, there is still a way the authority gets assigned and we don’t throw an exception from the method. This means, not being able to parse the server is ok and the exception is silenced. In our case, the server parsing fails because we find an illegal character, as only alphanumeric and dash characters are allowed.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13430/head:pull/13430$ git checkout pull/13430Update a local copy of the PR:
$ git checkout pull/13430$ git pull https://git.openjdk.org/jdk.git pull/13430/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13430View PR using the GUI difftool:
$ git pr show -t 13430Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13430.diff
Webrev
Link to Webrev Comment