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

SOLR-17595: Fix Solr examples for Windows #2909

Merged
merged 4 commits into from
Dec 17, 2024

Conversation

malliaridis
Copy link
Contributor

@malliaridis malliaridis commented Dec 14, 2024

https://issues.apache.org/jira/browse/SOLR-17595

Description

Since 9.7 the Solr examples (specifically the techproducts) are not working properly and throw an error on startup.

There are two issues in main. First bug is found in solr.cmd, in which the changes from #2875 run into. The argument parsing in Windows for -D options with multiple values, like -Dsolr.modules=module1,module2,module3, is failing, as each value of the same option is parsed as separate argument. The other bug is related to the wildcard used in the techproducts example. The usage of *.xml is apparently not supported. This may be Windows-specific.

Solution

The fix for the first issue is to iterate over the arguments in the script and include them all, similar to the parsing logic of other arguments.

The second fix for the wildcard is to switch to the --filetypes parameter to filter correctly the files by the xml filetype.

Note that If we want to support wildcards in the future, we may have to change the logic for parsing paths.

Please also note that a commit was accidentally pushed to main directly and therefore not included in the changes of this PR (see 44ea44d).

All fixes in this PR should be backported to 9x and 9.8, as they are likely present in previous versions, including 9.7.

Tests

Some changes are related to the Windows solr.cmd script for which we do not have any tests (see SOLR-17508), and the other changes simply remove unsupported glob patterns in PostTool arguments.

Checklist

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

@malliaridis malliaridis marked this pull request as ready for review December 14, 2024 16:45
@malliaridis malliaridis requested review from epugh and janhoy December 14, 2024 16:45
Copy link
Contributor

@janhoy janhoy left a comment

Choose a reason for hiding this comment

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

Is this PR incomplete? Was expecting a fix in cmd script according to the PR description?

EDIT Forget that, I looked at the commit directly to main now. Have no time to test it but it local tests fix the issue for you, I’m ok 👌 with this.

@malliaridis
Copy link
Contributor Author

Yeah, I messed up the PR by pushing the first fix first in main. So I have to make sure its included in the backport. I will merge by tomorrow if there is no objection by then. I have only tested the techproducts, so before I merge I will look into the other examples as well to make sure they all work properly.

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.

I very much appreciate your attention to detail and making sure our window's users have a good onboarding experience!

@malliaridis malliaridis merged commit a4229e7 into apache:main Dec 17, 2024
5 checks passed
malliaridis added a commit to malliaridis/solr that referenced this pull request Dec 17, 2024
* Fix argument parsing for -D options with multiple values on Windows

* Fix invalid usage of wildcards in RunExampleTool / PostTool

(cherry picked from commit a4229e7)
malliaridis added a commit that referenced this pull request Dec 18, 2024
* Fix argument parsing for -D options with multiple values on Windows

(cherry picked from commit 44ea44d)

* SOLR-17595: Fix Solr examples for Windows (#2909)

* Fix argument parsing for -D options with multiple values on Windows

* Fix invalid usage of wildcards in RunExampleTool / PostTool

(cherry picked from commit a4229e7)

* Fix unsupported method
malliaridis added a commit that referenced this pull request Dec 18, 2024
* Fix argument parsing for -D options with multiple values on Windows

(cherry picked from commit 44ea44d)

* SOLR-17595: Fix Solr examples for Windows (#2909)

* Fix argument parsing for -D options with multiple values on Windows

* Fix invalid usage of wildcards in RunExampleTool / PostTool

(cherry picked from commit a4229e7)

* Fix unsupported method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants