Skip to content

9x backport for "SOLR-7962 --jvm-opts with -e doesn't work on windows (#3347)" #3376

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

Merged

Conversation

rahulgoswami
Copy link
Contributor

@rahulgoswami rahulgoswami commented May 28, 2025

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

Description

  • solr.cmd wasn't passing additional arguments to SolrCLI when running an example (-e option)
  • Parsing of the prepared command line in RunExampleTool was breaking due to certain characters in the additional args. Eg: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:18983". commons-cli had to be "signaled" to ask cmd.exe to preserve the quotes while passing to start.cmd
  • If an additional arg (supplied with "--jvm-opts") starts with "-D", the parsing breaks.

Solution

  • Pass additional args to SolrCLI when running with -e
  • Parse the command in RunExampleTool without the additional args to prepare excec.CommandLine and then add the addtional args separately with quotes preserved.
  • If a system property (-D) is passed as an additional argument with --jvm-opts, pass it along to the RunExampleTool, unlike the other -D arguments.

Tests

Added bats test for jvm-opts with example

Checklist

Please review the following and check all that apply:

  • 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

@epugh epugh merged commit 7597d14 into apache:branch_9x May 28, 2025
4 checks passed
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