[ 
https://issues.apache.org/jira/browse/SOLR-17321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17860896#comment-17860896
 ] 

Chris M. Hostetter commented on SOLR-17321:
-------------------------------------------

Commit 2a56bfc2d8b48d1c93d683515569e2e97acf2077 appears to have caused 100% 
reliable failure in TestSolrCoreSnapshots.testBackupRestore on Windows 
machines...
{noformat}
org.apache.solr.core.snapshots.TestSolrCoreSnapshots > testBackupRestore FAILED
    java.lang.IllegalArgumentException: Illegal character in query at index 
120: 
http://127.0.0.1:63607/solr/admin/cores?action=BACKUPCORE&core=SolrCoreSnapshots_shard1_replica_n1&name=lefq&location=C:\Users\jenkins\workspace\Solr-main-Windows\solr\core\build\tmp\tests-tmp\org.apache.solr.core.snapshots.TestSolrCoreSnapshots_37066E3501CB60-001\tempDir-002&incremental=false&commitName=m
        at 
__randomizedtesting.SeedInfo.seed([37066E3501CB60:B68C06D007B2052E]:0)
        at java.base/java.net.URI.create(URI.java:911)
        at 
org.apache.solr.handler.BackupRestoreUtils.executeHttpRequest(BackupRestoreUtils.java:113)
        at 
org.apache.solr.handler.BackupRestoreUtils.runCoreAdminCommand(BackupRestoreUtils.java:92)
        at 
org.apache.solr.core.snapshots.TestSolrCoreSnapshots.testBackupRestore(TestSolrCoreSnapshots.java:144)
{noformat}
This seems to be because {{URI.create()}} is stricter in it's parsing then 
{{new URL()}} when dealing with characters that the spec says should be percent 
encoded (even though the resulting call to {{URL.openStream()}} in 
{{BackupRestoreUtils.executeHttpRequest}} doesn't actual care if those 
characters have been escaped - and jetty/solr are generally lenient about these 
things)...
{noformat}
  public void testURLvsURI() throws Exception {
    final String raw = 
"http://127.0.0.1:63607/solr/admin/cores?location=C:\\Windows\\Path\\&commitName=m";;

    final java.net.URL url_url = new java.net.URL(raw);                      // 
works just fine

    final java.net.URL uri_url = java.net.URI.create(raw).toURL();           // 
throws IllegalArgumentException

  }
{noformat}
 
----
 
While the "correct" fix for this exception in 
{{BackupRestoreUtils.executeHttpRequest}} is almost certainly to update the 
calling code to build a properly encoded URL string, the fact that this commit 
caused such a problem at all suggests more detailed review of all the code 
paths modified by 2a56bfc2d8b is probably warranted to sanity check if any 
other code paths in the code base are at risk of similar failures due to the 
stricter validation of {{URL.create()}}

> Bump minimum required Java version to 21
> ----------------------------------------
>
>                 Key: SOLR-17321
>                 URL: https://issues.apache.org/jira/browse/SOLR-17321
>             Project: Solr
>          Issue Type: Task
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Sanjay Dutt
>            Priority: Major
>          Time Spent: 8h
>  Remaining Estimate: 0h
>
> We are upgrading the minimum Java version for Solr main branch to 21. 
> However, at the same, It has been suggested to be not so aggressive with 
> SolrJ (and thus solr-api, a dependency) Java version – setting it to 17.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to