Skip to content

[branch_9x] SOLR-17321: Remove Deprecated URL ctors in Preparation for Java 21 (…#2528

Merged
iamsanjay merged 5 commits intoapache:branch_9xfrom
iamsanjay:backport_9x_deprecated_URL
Aug 22, 2024
Merged

[branch_9x] SOLR-17321: Remove Deprecated URL ctors in Preparation for Java 21 (…#2528
iamsanjay merged 5 commits intoapache:branch_9xfrom
iamsanjay:backport_9x_deprecated_URL

Conversation

@iamsanjay
Copy link
Contributor

#2501 backport blocked due to SOLR-16911. For conflicted files, I used the older code only rather than moving bits from #1810

…pache#2501)

* Switch to URI
* Added URL to the forbidden API

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

Co-authored-by:  Uwe Schindler <uschindler@apache.org>
Co-authored-by: David Smiley <dsmiley@apache.org>
(cherry picked from commit 2a56bfc)
@iamsanjay iamsanjay requested review from epugh and gerlowskija June 21, 2024 15:44
Copy link
Contributor

@epugh epugh left a comment

Choose a reason for hiding this comment

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

LGTM. I assume you saw the one precommit burp.

@iamsanjay iamsanjay requested a review from uschindler June 21, 2024 17:51
@iamsanjay
Copy link
Contributor Author

I’d like to resolve this issue, but before that, we need to address issue #2539. A test case failed on a Windows machine because of the backslash character. URI is stricter compared to URL, which raises some concerns about this code change. Could there be more failures like this if we merge this code into 9_x?

I am going to point out all the main core classes (not the test cases) where we swapped URL with URI. I’d really appreciate any feedback on whether you think this change might cause issues, especially with passing a string that could contain special characters.

@iamsanjay
Copy link
Contributor Author

Mainly, we are looking for any special character that could fail the URI parsing. So far there is one example from the past where passing caret(^) symbol in the query params failed it, and now recently with passing backslash() in the path query params.

@epugh
Copy link
Contributor

epugh commented Jul 5, 2024

Mainly, we are looking for any special character that could fail the URI parsing. So far there is one example from the past where passing caret(^) symbol in the query params failed it, and now recently with passing backslash() in the path query params.

I don't think I quite understand the thrust of your comment/question. We should be properly handling all URI to obey the stricket definition, and if we aren't, we should figure out why and fix it right? I think the changes you've made here are right, and our testing should pick if there are other places that URI being stricter than URL causes an issue then we fix them as we go?

At least as far as I know there aren't any special nuances that would cause problems, but again, I only know parts of Solr's code base! I suppose if we had the ability to "fuzz" our inputs we could proactively test out all the variations of the old URL inputs to test them, but that feels like a major undertaking!

@iamsanjay
Copy link
Contributor Author

cherry-picked the latest fix (#2539) and moved the change description under 9.8. Should we consider including this in 9.7 if it's still possible?

@epugh
Copy link
Contributor

epugh commented Aug 10, 2024

I lean towards letting this happen in 9.8... Since what we really care is that this gets us to Java 21 which will only be in main, when this code actually goes out doesn't matter, and the 9.7 release branch has already been cut.

@epugh epugh self-assigned this Aug 10, 2024
@epugh
Copy link
Contributor

epugh commented Aug 10, 2024

I will leave this open for another few days, just to see if we get any other +1 on the code change, and then look to merge.

@iamsanjay
Copy link
Contributor Author

Can we merge this one?

@epugh
Copy link
Contributor

epugh commented Aug 22, 2024

Tests all pass, and no issues raised, so I htink you can merge!

@iamsanjay iamsanjay merged commit 9bd991f into apache:branch_9x Aug 22, 2024
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

Successfully merging this pull request may close these issues.

2 participants