Re: [PR] SOLR-17450 StatusTool with pure Java code [solr]
janhoy commented on code in PR #2712: URL: https://github.com/apache/solr/pull/2712#discussion_r1802537974 ## gradle/testing/randomization/policies/solr-tests.policy: ## @@ -109,6 +109,8 @@ grant { permission java.lang.RuntimePermission "writeFileDescriptor"; // needed by hadoop http permission java.lang.RuntimePermission "getProtectionDomain"; + // SolrProcessMgr to list processes + permission java.lang.RuntimePermission "manageProcess"; Review Comment: You're right. But since this targets 9.x, we still need it. When someone rips out security manager related stuff in main before the 10.0 release, this will be gone of course. But not right now.. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] Update dependency com.fasterxml.jackson:jackson-bom to v2.18.0 [solr]
janhoy merged PR #2769: URL: https://github.com/apache/solr/pull/2769 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] Bump up Java version to 21 [solr]
iamsanjay commented on PR #2682: URL: https://github.com/apache/solr/pull/2682#issuecomment-2415907145 JDK 14 Release Notes -XX:UseConcMarkSweepGC has been removed. I believe, we still using in solr.cmd.in. Other than that I have gone through the release notes and did'nt find anything which we are still using and has been removed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] Update io.grpc:grpc-* to v1.68.0 [solr]
janhoy commented on PR #2639: URL: https://github.com/apache/solr/pull/2639#issuecomment-2416405035 What a mess https://github.com/user-attachments/assets/73683273-0583-4afa-87a0-30f001ba2aeb";> So in reality 1.67.1 is the latest version, but no dependency manager in the world will ever know :) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
[PR] Update dependency com.fasterxml.jackson:jackson-bom to v2.18.0 [solr]
solrbot opened a new pull request, #2769: URL: https://github.com/apache/solr/pull/2769 This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [com.fasterxml.jackson:jackson-bom](https://redirect.github.com/FasterXML/jackson-bom) | dependencies | minor | `2.17.2` -> `2.18.0` | --- ### Configuration 📅 **Schedule**: Branch creation - "* * * * *" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/solrbot/renovate-github-action) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
[PR] Update dependency org.semver4j:semver4j to v5.4.0 [solr]
solrbot opened a new pull request, #2770: URL: https://github.com/apache/solr/pull/2770 This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [org.semver4j:semver4j](https://redirect.github.com/semver4j/semver4j) | dependencies | minor | `5.3.0` -> `5.4.0` | --- ### Release Notes semver4j/semver4j (org.semver4j:semver4j) ### [`v5.4.0`](https://redirect.github.com/semver4j/semver4j/releases/tag/v5.4.0) What's Changed 🚀 Features - ([#​258](https://redirect.github.com/semver4j/semver4j/issues/258)) Reworking range processors to short-circuit when a suitable parsed range is found by [@​severn-everett](https://redirect.github.com/severn-everett) 🛠Refactor - ([#​256](https://redirect.github.com/semver4j/semver4j/issues/256)) RangeProcessorPipeline iterative processing by [@​severn-everett](https://redirect.github.com/severn-everett) 📦 Dependency Updates 22 changes - ([#​281](https://redirect.github.com/semver4j/semver4j/issues/281)) Bump peter-evans/create-pull-request from 7.0.0 to 7.0.2 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​279](https://redirect.github.com/semver4j/semver4j/issues/279)) Bump peter-evans/create-pull-request from 6.1.0 to 7.0.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​276](https://redirect.github.com/semver4j/semver4j/issues/276)) Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.8.0 to 3.10.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​277](https://redirect.github.com/semver4j/semver4j/issues/277)) Bump org.apache.maven.plugins:maven-surefire-plugin from 3.4.0 to 3.5.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​278](https://redirect.github.com/semver4j/semver4j/issues/278)) Bump org.mockito:mockito-core from 5.12.0 to 5.13.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​275](https://redirect.github.com/semver4j/semver4j/issues/275)) Bump org.apache.maven.plugins:maven-checkstyle-plugin from 3.4.0 to 3.5.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​274](https://redirect.github.com/semver4j/semver4j/issues/274)) Bump org.apache.maven.plugins:maven-surefire-plugin from 3.3.1 to 3.4.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​273](https://redirect.github.com/semver4j/semver4j/issues/273)) Bump org.junit.jupiter:junit-jupiter from 5.10.3 to 5.11.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​272](https://redirect.github.com/semver4j/semver4j/issues/272)) Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.4 to 3.2.5 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​271](https://redirect.github.com/semver4j/semver4j/issues/271)) Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.7.0 to 3.8.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​270](https://redirect.github.com/semver4j/semver4j/issues/270)) Bump org.apache.maven.plugins:maven-surefire-plugin from 3.3.0 to 3.3.1 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​269](https://redirect.github.com/semver4j/semver4j/issues/269)) Bump org.assertj:assertj-core from 3.26.0 to 3.26.3 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​268](https://redirect.github.com/semver4j/semver4j/issues/268)) Bump org.junit.jupiter:junit-jupiter from 5.10.2 to 5.10.3 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​267](https://redirect.github.com/semver4j/semver4j/issues/267)) Bump org.apache.maven.plugins:maven-jar-plugin from 3.4.1 to 3.4.2 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​266](https://redirect.github.com/semver4j/semver4j/issues/266)) Bump peter-evans/create-pull-request from 6.0.5 to 6.1.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​265](https://redirect.github.com/semver4j/semver4j/issues/265)) Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.5 to 3.3.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​262](https://redirect.github.com/semver4j/semver4j/issues/262)) Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.3 to 3.7.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​263](https://redirect.github.com/semver4j/semver4j/issues/263)) Bump org.apache.maven.plugins:maven-checkstyle-plugin from 3.3.1 to 3.4.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​261](https://redirect.github.com/semver4j/semver4j/issues/261)) Bump org.sonatype.plugins:nexus-staging-maven-plugin from 1.6.13 to 1.7.0 by [@​dependabot](https://redirect.github.com/dependabot) - ([#​260](https://redirect.github.com/semver4j/semver4j/issues/260)) Bump org.assertj:assertj-core fr
[PR] Update org.apache.calcite to v1.38.0 [solr]
solrbot opened a new pull request, #2771: URL: https://github.com/apache/solr/pull/2771 This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [org.apache.calcite:calcite-linq4j](https://calcite.apache.org) ([source](https://redirect.github.com/apache/calcite)) | dependencies | minor | `1.37.0` -> `1.38.0` | | [org.apache.calcite:calcite-core](https://calcite.apache.org) ([source](https://redirect.github.com/apache/calcite)) | dependencies | minor | `1.37.0` -> `1.38.0` | --- ### Configuration 📅 **Schedule**: Branch creation - "* * * * *" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/solrbot/renovate-github-action) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
[PR] Update org.apache.kafka:* to v3.8.0 [solr]
solrbot opened a new pull request, #2772: URL: https://github.com/apache/solr/pull/2772 This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [org.apache.kafka:kafka_2.13](https://kafka.apache.org) | dependencies | minor | `3.7.1` -> `3.8.0` | | [org.apache.kafka:kafka-tools-api](https://kafka.apache.org) | dependencies | minor | `3.7.1` -> `3.8.0` | | [org.apache.kafka:kafka-streams](https://kafka.apache.org) | dependencies | minor | `3.7.1` -> `3.8.0` | | [org.apache.kafka:kafka-storage-api](https://kafka.apache.org) | dependencies | minor | `3.7.1` -> `3.8.0` | | [org.apache.kafka:kafka-storage](https://kafka.apache.org) | dependencies | minor | `3.7.1` -> `3.8.0` | | [org.apache.kafka:kafka-server-common](https://kafka.apache.org) | dependencies | minor | `3.7.1` -> `3.8.0` | | [org.apache.kafka:kafka-server](https://kafka.apache.org) | dependencies | minor | `3.7.1` -> `3.8.0` | | [org.apache.kafka:kafka-raft](https://kafka.apache.org) | dependencies | minor | `3.7.1` -> `3.8.0` | | [org.apache.kafka:kafka-metadata](https://kafka.apache.org) | dependencies | minor | `3.7.1` -> `3.8.0` | | [org.apache.kafka:kafka-group-coordinator](https://kafka.apache.org) | dependencies | minor | `3.7.1` -> `3.8.0` | | [org.apache.kafka:kafka-clients](https://kafka.apache.org) | dependencies | minor | `3.7.1` -> `3.8.0` | --- ### Configuration 📅 **Schedule**: Branch creation - "* * * * *" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/solrbot/renovate-github-action) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
[PR] Update org.apache.curator:* to v5.7.1 [solr]
solrbot opened a new pull request, #2768: URL: https://github.com/apache/solr/pull/2768 This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [org.apache.curator:curator-recipes](https://curator.apache.org) ([source](https://redirect.github.com/apache/curator)) | dependencies | patch | `5.7.0` -> `5.7.1` | | [org.apache.curator:curator-framework](https://curator.apache.org) ([source](https://redirect.github.com/apache/curator)) | dependencies | patch | `5.7.0` -> `5.7.1` | | [org.apache.curator:curator-client](https://curator.apache.org) ([source](https://redirect.github.com/apache/curator)) | dependencies | patch | `5.7.0` -> `5.7.1` | --- ### Configuration 📅 **Schedule**: Branch creation - "* * * * *" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/solrbot/renovate-github-action) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] Bump up Java version to 21 [solr]
iamsanjay commented on PR #2682: URL: https://github.com/apache/solr/pull/2682#issuecomment-2415956590 Since JDK 14 https://openjdk.org/jeps/363 Concurrent Mark Sweep (CMS) garbage collector is removed. So may be can remove that and whatever is related to it (Which I am not fully aware of) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] SOLR-17413: ulog replay should copy SolrQueryRequest [solr]
gerlowskija commented on code in PR #2765: URL: https://github.com/apache/solr/pull/2765#discussion_r1803271038 ## solr/core/src/java/org/apache/solr/update/UpdateLog.java: ## @@ -2097,10 +2098,19 @@ public void doReplay(TransactionLog translog) { UpdateRequestProcessorChain processorChain = req.getCore().getUpdateProcessingChain(null); Collection procPool = Collections.synchronizedList(new ArrayList<>()); +final var params = +new MapSolrParams( +Map.of( +DISTRIB_UPDATE_PARAM, +FROMLEADER.toString(), +DistributedUpdateProcessor.LOG_REPLAY, +"true")); ThreadLocal procThreadLocal = ThreadLocal.withInitial( () -> { - var proc = processorChain.createProcessor(req, rsp); + // SolrQueryRequest is not thread-safe, so use a copy when creating URPs + final var solrQueryRequest = new LocalSolrQueryRequest(uhandler.core, params); Review Comment: Done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] SOLR-17450 StatusTool with pure Java code [solr]
janhoy commented on code in PR #2712: URL: https://github.com/apache/solr/pull/2712#discussion_r1803388476 ## solr/server/etc/security.policy: ## @@ -228,4 +228,7 @@ grant { // expanded to a wildcard if set, allows all networking everywhere permission java.net.SocketPermission "${solr.internal.network.permission}", "accept,listen,connect,resolve"; + + // Used by SolrProcessManager to find commandLine of a running Windows process + permission java.io.FilePermission "C:\\Windows\\*\\wmic.exe", "execute"; Review Comment: Thinking about it, since status tool is only used from CLI and not from Solr server, we don't need this permission, since CLI runs without security mgr. I'll remove this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] SOLR-17450 StatusTool with pure Java code [solr]
janhoy commented on code in PR #2712: URL: https://github.com/apache/solr/pull/2712#discussion_r1803391559 ## gradle/testing/randomization/policies/solr-tests.policy: ## @@ -109,6 +109,8 @@ grant { permission java.lang.RuntimePermission "writeFileDescriptor"; // needed by hadoop http permission java.lang.RuntimePermission "getProtectionDomain"; + // SolrProcessMgr to list processes + permission java.lang.RuntimePermission "manageProcess"; Review Comment: No big deal, it will anyway land in main first. And if security manager is removed in main branch before this is merged, we'll of course have to take action.. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
[jira] [Resolved] (SOLR-17158) Terminate distributed processing quickly when query limit is reached
[ https://issues.apache.org/jira/browse/SOLR-17158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gus Heck resolved SOLR-17158. - Fix Version/s: main (10.0) 9.8 Resolution: Implemented > Terminate distributed processing quickly when query limit is reached > > > Key: SOLR-17158 > URL: https://issues.apache.org/jira/browse/SOLR-17158 > Project: Solr > Issue Type: Sub-task > Components: Query Limits >Reporter: Andrzej Bialecki >Assignee: Gus Heck >Priority: Major > Labels: pull-request-available > Fix For: main (10.0), 9.8 > > Time Spent: 8h 50m > Remaining Estimate: 0h > > Solr should make sure that when query limits are reached and partial results > are not needed (and not wanted) then both the processing in shards and in the > query coordinator should be terminated as quickly as possible, and Solr > should minimize wasted resources spent on eg. returning data from the > remaining shards, merging responses in the coordinator, or returning any data > back to the user. -- 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
Re: [PR] SOLR-17450 StatusTool with pure Java code [solr]
janhoy commented on PR #2712: URL: https://github.com/apache/solr/pull/2712#issuecomment-2417306791 Did more testing. The output when starting Solr on Win was broken and printed the json status text on Win, while on Linux it still printed `Started Solr server on port (pid=6838). Happy searching!`. So for `bin/solr` we still print that text in the shell script, but on Windows, we delegate it to StatusTool. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] SOLR-17450 StatusTool with pure Java code [solr]
janhoy commented on code in PR #2712: URL: https://github.com/apache/solr/pull/2712#discussion_r1803440828 ## solr/core/src/java/org/apache/solr/cli/StatusTool.java: ## @@ -65,72 +73,224 @@ public String getName() { .desc("Wait up to the specified number of seconds to see Solr running.") .build(); + public static final Option OPTION_PORT = + Option.builder("p") + .longOpt("port") + .argName("PORT") + .required(false) + .hasArg() + .desc("Port on localhost to check status for") + .build(); + + public static final Option OPTION_SHORT = + Option.builder() + .longOpt("short") + .argName("SHORT") + .required(false) + .desc("Short format. Prints one URL per line for running instances") + .build(); + @Override public List getOptions() { -return List.of( -// The solr-url option is not exposed to the end user, and is -// created by the bin/solr script and passed into this command directly, -// therefore we don't use the SolrCLI.OPTION_SOLRURL. -Option.builder() -.argName("URL") -.longOpt("solr-url") -.hasArg() -.required(false) -.desc("Property set by calling scripts, not meant for user configuration.") -.build(), -OPTION_MAXWAITSECS); +return List.of(OPTION_SOLRURL, OPTION_MAXWAITSECS, OPTION_PORT, OPTION_SHORT); } @Override public void runImpl(CommandLine cli) throws Exception { -// Override the default help behaviour to put out a customized message that only list user -// settable Options. -if ((cli.getOptions().length == 0 && cli.getArgs().length == 0) -|| cli.hasOption("h") -|| cli.hasOption("help")) { - final Options options = new Options(); - options.addOption(OPTION_MAXWAITSECS); - new HelpFormatter().printHelp("status", options); - return; +String solrUrl = cli.getOptionValue(OPTION_SOLRURL); +Integer port = +cli.hasOption(OPTION_PORT) ? Integer.parseInt(cli.getOptionValue(OPTION_PORT)) : null; +boolean shortFormat = cli.hasOption(OPTION_SHORT); +int maxWaitSecs = Integer.parseInt(cli.getOptionValue("max-wait-secs", "0")); + +if (port != null && solrUrl != null) { + throw new IllegalArgumentException("Only one of port or url can be specified"); } -int maxWaitSecs = Integer.parseInt(cli.getOptionValue("max-wait-secs", "0")); -String solrUrl = SolrCLI.normalizeSolrUrl(cli); -if (maxWaitSecs > 0) { - int solrPort = new URI(solrUrl).getPort(); - echo("Waiting up to " + maxWaitSecs + " seconds to see Solr running on port " + solrPort); - try { -waitToSeeSolrUp( -solrUrl, -cli.getOptionValue(SolrCLI.OPTION_CREDENTIALS.getLongOpt()), -maxWaitSecs, -TimeUnit.SECONDS); -echo("Started Solr server on port " + solrPort + ". Happy searching!"); - } catch (TimeoutException timeout) { -throw new Exception( -"Solr at " + solrUrl + " did not come online within " + maxWaitSecs + " seconds!"); +if (solrUrl != null) { + // URL provided, do not consult local processes, as the URL may be remote + if (maxWaitSecs > 0) { +// Used by Windows start script when starting Solr +try { + waitForSolrUpAndPrintStatus(solrUrl, cli, maxWaitSecs); Review Comment: I don't like the fact that the output text changes completely based on a flag like `--max-wait-secs`, but that's what I added now to get the windows print correct. @epugh I believe you added this at some point. I'd suggest that `--max-wait-secs` only triggers the wait-and-retry logic and still prints the JSON output. Then we could use the exit code (0 or 1) from the statusTool to choose what to print in `solr.cmd`. Comments? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] SOLR-17158 Terminate distributed processing faster when query limits reached and partial results are not needed (#2666) [solr]
gus-asf merged PR #2773: URL: https://github.com/apache/solr/pull/2773 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
[jira] [Commented] (SOLR-17158) Terminate distributed processing quickly when query limit is reached
[ https://issues.apache.org/jira/browse/SOLR-17158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17890108#comment-17890108 ] ASF subversion and git services commented on SOLR-17158: Commit 6dbd8d1b8e0e1690b048e32bf152837b5a341fee in solr's branch refs/heads/branch_9x from Gus Heck [ https://gitbox.apache.org/repos/asf?p=solr.git;h=6dbd8d1b8e0 ] SOLR-17158 Terminate distributed processing faster when query limit is reached and partial results are not needed (#2666) (#2773) (cherry picked from commit b748207bc331b5eeae284ee7602626dbe5e3ff50) > Terminate distributed processing quickly when query limit is reached > > > Key: SOLR-17158 > URL: https://issues.apache.org/jira/browse/SOLR-17158 > Project: Solr > Issue Type: Sub-task > Components: Query Limits >Reporter: Andrzej Bialecki >Assignee: Gus Heck >Priority: Major > Labels: pull-request-available > Time Spent: 8h 50m > Remaining Estimate: 0h > > Solr should make sure that when query limits are reached and partial results > are not needed (and not wanted) then both the processing in shards and in the > query coordinator should be terminated as quickly as possible, and Solr > should minimize wasted resources spent on eg. returning data from the > remaining shards, merging responses in the coordinator, or returning any data > back to the user. -- 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
[jira] [Created] (SOLR-17499) Windows start script should wait 180 secs for Solr start
Jan Høydahl created SOLR-17499: -- Summary: Windows start script should wait 180 secs for Solr start Key: SOLR-17499 URL: https://issues.apache.org/jira/browse/SOLR-17499 Project: Solr Issue Type: Bug Security Level: Public (Default Security Level. Issues are Public) Components: cli, scripts and tools Reporter: Jan Høydahl The bin/solr.cmd script waits only 30 seconds for Solr to come up, while the Linux script has used 180 seconds for years. We should change windows script to use 180 as well. -- 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
[jira] [Updated] (SOLR-17499) Windows start script should wait 180 secs for Solr start
[ https://issues.apache.org/jira/browse/SOLR-17499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jan Høydahl updated SOLR-17499: --- Labels: Beginner beginner-friendly newdev (was: ) > Windows start script should wait 180 secs for Solr start > > > Key: SOLR-17499 > URL: https://issues.apache.org/jira/browse/SOLR-17499 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public) > Components: cli, scripts and tools >Reporter: Jan Høydahl >Priority: Major > Labels: Beginner, beginner-friendly, newdev > > The bin/solr.cmd script waits only 30 seconds for Solr to come up, while the > Linux script has used 180 seconds for years. > We should change windows script to use 180 as well. -- 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
Re: [PR] SOLR-17494: Document deprecation status of language specific writer types [solr]
gerlowskija commented on PR #2766: URL: https://github.com/apache/solr/pull/2766#issuecomment-2417053569 Should we have a CHANGES.txt entry mentioning the deprecation? That looks like a popular place that deprecations are highlighted... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] SOLR-17450 StatusTool with pure Java code [solr]
epugh commented on code in PR #2712: URL: https://github.com/apache/solr/pull/2712#discussion_r1802975213 ## gradle/testing/randomization/policies/solr-tests.policy: ## @@ -109,6 +109,8 @@ grant { permission java.lang.RuntimePermission "writeFileDescriptor"; // needed by hadoop http permission java.lang.RuntimePermission "getProtectionDomain"; + // SolrProcessMgr to list processes + permission java.lang.RuntimePermission "manageProcess"; Review Comment: I would be fine with this as 10 if that makes your life easier.. kind of like the basic auth for CLI being 10x only... I am assuming 10x is only months away! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] SOLR-17413: ulog replay should copy SolrQueryRequest [solr]
gerlowskija commented on PR #2765: URL: https://github.com/apache/solr/pull/2765#issuecomment-2416735316 > Is the not-anymore-used req object still used somewhere else? Yes, actually! Meant to call this out in a comment here or in the code - the "original" LocalSolrQueryRequest is technically still accessible on the UpdateCommand seen by individual processors. So there's still the possibility this object could be messed with by multiple threads. That said - I don't think this is a risk in practice. I spent a good bit of time tracing through all of the `UpdateCommand.getReq()` invocations, and they're all "read only" calls to get either the SolrCore or the IndexSchema relevant to this request. (Both of which are commonly used across threads.) Both from this and from the problem David described above, it's clear that the UpdateLog replay threading could use a larger rethink, but I'm reluctant to dive into that here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
[PR] SOLR-17158 Terminate distributed processing faster when query limits reached and partial results are not needed (#2666) [solr]
gus-asf opened a new pull request, #2773: URL: https://github.com/apache/solr/pull/2773 backport -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] SOLR-17406: Introduce Version Catalogs [solr]
malliaridis commented on PR #2706: URL: https://github.com/apache/solr/pull/2706#issuecomment-2417694767 I think it would be a good idea to first resolve the current solrbot PRs before aligning the versions. I am already looking into some of the PRs to see how they can be resolved. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] SOLR-17413: ulog replay should copy SolrQueryRequest [solr]
dsmiley commented on PR #2765: URL: https://github.com/apache/solr/pull/2765#issuecomment-2417910950 I'd like to contribute to this PR to replace the ThreadLocal with a re-using pool that we mostly already have. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] SOLR-17390: EmbeddedSolrServer now considers the ResponseParser [solr]
epugh commented on code in PR #2774: URL: https://github.com/apache/solr/pull/2774#discussion_r1803997991 ## solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java: ## @@ -934,13 +934,7 @@ protected void logAndFlushAdminRequest(SolrQueryResponse solrResp) throws IOExce * returns the default query response writer Note: This method must not return null */ protected QueryResponseWriter getResponseWriter() { -String wt = solrReq.getParams().get(CommonParams.WT); Review Comment: I love this werid logic being removed! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] SOLR-17485 Remove CheckLoggingConfiguration; unnecessary [solr]
dsmiley commented on PR #2763: URL: https://github.com/apache/solr/pull/2763#issuecomment-2418420895 Addressing your nit on renaming `_request` to `request` wasn't fully possible for various reasons at first, so I started pulling on that thread, doing some refactoring that ultimately led to me doing that rename. CC @gus-asf for review on my changes (commit messages explain what I did too). Happy to decouple such changes to another PR; it's out of scope. Granted the scope has been somewhat flexible, maybe too much... this started with me wondering, why can't we just use HttpServletRequest instead of the old ServletRequest. Oh hey look, we have some old base class that isn't what I expect, doing some old logging stuff that's obsolete / useless (IMO). So let's just subclass HttpFilter. An aside, the excludedPath thing seems bolted on and shouldn't have been added. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] Demonstrate a test framework bug [solr]
github-actions[bot] commented on PR #2242: URL: https://github.com/apache/solr/pull/2242#issuecomment-2418183084 This PR is now closed due to 60 days of inactivity after being marked as stale. Re-opening this PR is still possible, in which case it will be marked as active again. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
Re: [PR] Demonstrate a test framework bug [solr]
github-actions[bot] closed pull request #2242: Demonstrate a test framework bug URL: https://github.com/apache/solr/pull/2242 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
[jira] [Commented] (SOLR-11872) Refactor test infra to work with a managed SolrClient; ditch TestHarness
[ https://issues.apache.org/jira/browse/SOLR-11872?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17890262#comment-17890262 ] David Smiley commented on SOLR-11872: - Note to self/others:  a test that best illustrates where a generic/common initialization would be valuable across Cloud & Jett is TestRawTransformer.  It manually sets up Cloud & Jetty; ideally it'd be just one configuration, and less of it. > Refactor test infra to work with a managed SolrClient; ditch TestHarness > > > Key: SOLR-11872 > URL: https://issues.apache.org/jira/browse/SOLR-11872 > Project: Solr > Issue Type: Improvement > Components: Tests >Reporter: David Smiley >Priority: Major > Labels: gsoc2021, mentor > > This is a proposal to substantially refactor SolrTestCaseJ4 and some of its > intermediate subclasses in the hierarchy.  _In essence, I envision that tests > should work with a SolrClient typed "solrClient" field managed by the test > infrastructure._ With only a few lines of code, a test should be able to pick > between an instance based on EmbeddedSolrServer (lighter tests), > HttpSolrClient (tests HTTP/Jetty behavior directly or indirectly), SolrCloud, > and perhaps a special one for our distributed search tests. STCJ4 would > refactor its methods to use the solrClient field _instead of TestHarness_. > TestHarness would disappear as-such; bits of its existing code would migrate > elsewhere, such as to manage an EmbeddedSolrServer for testing. > I think we can do a transition like this in stages and furthermore minimally > affecting most tests by adding some deprecated shims. Perhaps STCJ4 should > _become_ the deprecated shim so that users can still use it during 7.x and to > help us with the transition internally too. More specifically, we'd add a new > superclass to STCJ4 that is the future – "SolrTestCase". > Additionally, there are a bunch of methods on SolrTestCaseJ4 that I question > the design of, especially ones that return XML strings like {{delI}} > (generates a delete-by-id XML string) and {{adoc}}. Perhaps that used to be a > fine idea before there was a convenient SolrClient API but we've got one now > and a test shouldn't be building XML unless it's trying to test exactly that. > For consulting work I once developed a JUnit4 {{TestRule}} managing a > SolrClient that is declared in a test with an annotation of {{@ClassRule}}. I > had a variation for SolrCloud and EmbeddedSolrServer that was easy for a test > to choose. Since TestRule is an interface, I was able to make a special > delegating SolrClient subclass that implements TestRule. This isn't essential > but makes use of it easier since otherwise you'd be forced to call something > like getSolrClient(). We could go the TestRule route here, which I prefer > (with or without having it subclass SolrClient), or we could alternatively do > TestCase subclassing to manage the lifecycle. > Initially I'm just looking for agreement and refinement of the approach. > After that, sub-tasks ought to be added. I won't have time to work on this > for some time. -- 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
Re: [PR] SOLR-17390: EmbeddedSolrServer now considers the ResponseParser [solr]
dsmiley commented on code in PR #2774: URL: https://github.com/apache/solr/pull/2774#discussion_r1803994463 ## solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java: ## @@ -217,62 +218,18 @@ public NamedList request(SolrRequest request, String coreName) throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "unknown handler: " + path); } req = - _parser.buildRequestFrom( - core, params, getContentStreams(request), request.getUserPrincipal()); + core.getSolrConfig() + .getRequestParsers() Review Comment: Using a SolrCore's SolrRequestParsers instance instead of a default one on this class means we work with parsers and configuration specific to the core. This was previously simply overlooked. ## solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java: ## @@ -250,7 +250,8 @@ public final T process(SolrClient client, String collection) throws SolrServerException, IOException { long startNanos = System.nanoTime(); T res = createResponse(client); -res.setResponse(client.request(this, collection)); +var namedList = client.request(this, collection); Review Comment: put on its own line to help debugger step-in. I've meant to do this for years. ## solr/core/src/test/org/apache/solr/response/TestRawTransformer.java: ## @@ -60,7 +61,11 @@ public static void beforeClass() throws Exception { if (random().nextBoolean()) { initStandalone(); JSR.start(); - CLIENT = JSR.newClient(); + if (random().nextBoolean()) { +CLIENT = JSR.newClient(); + } else { +CLIENT = new EmbeddedSolrServer(JSR.getCoreContainer(), null); Review Comment: it works; I re-rean the test enough times to see it does, with code coverage. Not in this PR, I also played with flipping SolrTestCaseHS and some other ZK endpoint test, which helped improve this PR by uncovering things, but those changes seemed like too much scope right now. ## solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java: ## @@ -217,62 +218,18 @@ public NamedList request(SolrRequest request, String coreName) throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "unknown handler: " + path); } req = - _parser.buildRequestFrom( - core, params, getContentStreams(request), request.getUserPrincipal()); + core.getSolrConfig() + .getRequestParsers() + .buildRequestFrom( + core, params, getContentStreams(request), request.getUserPrincipal()); req.getContext().put(PATH, path); req.getContext().put("httpMethod", request.getMethod().name()); SolrQueryResponse rsp = new SolrQueryResponse(); SolrRequestInfo.setRequestInfo(new SolrRequestInfo(req, rsp)); core.execute(handler, req, rsp); checkForExceptions(rsp); - - // Check if this should stream results - if (request.getStreamingResponseCallback() != null) { Review Comment: moved to writeResponse and simplified a little ## solr/core/src/java/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.java: ## @@ -285,12 +242,89 @@ ByteArrayInputStream toInputStream() { } } - private Set getContentStreams(SolrRequest request) throws IOException { -if (request.getMethod() == SolrRequest.METHOD.GET) return null; + private static SolrParams getParams(SolrRequest request) { +var params = request.getParams(); +var responseParser = request.getResponseParser(); +if (responseParser == null) { + responseParser = new BinaryResponseParser(); +} +var addParams = +new MapSolrParams( +Map.of( +CommonParams.WT, +responseParser.getWriterType(), +CommonParams.VERSION, +responseParser.getVersion())); +return SolrParams.wrapDefaults(addParams, params); + } + + private NamedList writeResponse( + SolrRequest request, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException { +ResponseParser responseParser = request.getResponseParser(); +if (responseParser == null) { + responseParser = new BinaryResponseParser(); +} +StreamingResponseCallback callback = request.getStreamingResponseCallback(); +// TODO refactor callback to be a special responseParser that we check for +// TODO if responseParser is a special/internal NamedList ResponseParser, just return NL + +var byteBuffer = +new ByteArrayOutputStream() { + ByteArrayInputStream toInputStream() { +return new ByteArrayInputStream(buf, 0, count); + } +}; + +if (callback == null) { + QueryResponseWriterUtil.writeQueryResponse( + byteBuffer, req.getResponseWriter(), req, rsp, null); +} else { +
Re: [PR] SOLR-17390: EmbeddedSolrServer now considers the ResponseParser [solr]
dsmiley commented on code in PR #2774: URL: https://github.com/apache/solr/pull/2774#discussion_r1804007364 ## solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java: ## @@ -934,13 +934,7 @@ protected void logAndFlushAdminRequest(SolrQueryResponse solrResp) throws IOExce * returns the default query response writer Note: This method must not return null */ protected QueryResponseWriter getResponseWriter() { -String wt = solrReq.getParams().get(CommonParams.WT); Review Comment: it has moved: > Moved HttpSolrCall.getResponseWriter to SolrQueryRequest It wasn't specific to HTTP; EmbeddedSolrServer needs to call the same logic. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
[PR] SOLR-17390: EmbeddedSolrServer now considers the ResponseParser [solr]
dsmiley opened a new pull request, #2774: URL: https://github.com/apache/solr/pull/2774 * Moved HttpSolrCall.getResponseWriter to SolrQueryRequest * Subtle improvements to make ContentStream work when they might not have https://issues.apache.org/jira/browse/SOLR-17390 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org
[jira] [Updated] (SOLR-17390) EmbeddedSolrServer should support a ResponseParser
[ https://issues.apache.org/jira/browse/SOLR-17390?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ASF GitHub Bot updated SOLR-17390: -- Labels: pull-request-available (was: ) > EmbeddedSolrServer should support a ResponseParser > -- > > Key: SOLR-17390 > URL: https://issues.apache.org/jira/browse/SOLR-17390 > Project: Solr > Issue Type: Improvement >Reporter: David Smiley >Assignee: David Smiley >Priority: Major > Labels: pull-request-available > Time Spent: 10m > Remaining Estimate: 0h > > By default, a SolrRequest has a null/unspecified ResponseParser; it's handled > automatically within SolrJ. But an explicit one communicates an intent for > the client code to need it, like JsonMapResponseParser, > InputStreamResponseParser, or NoOpResponseParser (particularly those 3). > EmbeddedSolrServer doesn't look at this; the NamedList right out of the > core/handler is normalized (via javabin round-trip) and returned. While that > makes sense _normally_, a ResponseParser should also be supported. This > enables tests that might want to use EmbeddedSolrServer but that which need > to test JSON or XML (for convenience of xpath/json expressions, for example). > Also, the newer V2 API generated clients would need this to support > EmbeddedSolrServer as they are currently based off of > InputStreamResponseParser. > Doing this means determining the correct ResponseWriter (not assuming JavaBin > during normalization). -- 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
Re: [PR] SOLR-17450 StatusTool with pure Java code [solr]
epugh commented on code in PR #2712: URL: https://github.com/apache/solr/pull/2712#discussion_r1804003579 ## solr/core/src/java/org/apache/solr/cli/StatusTool.java: ## @@ -65,72 +73,224 @@ public String getName() { .desc("Wait up to the specified number of seconds to see Solr running.") .build(); + public static final Option OPTION_PORT = + Option.builder("p") + .longOpt("port") + .argName("PORT") + .required(false) + .hasArg() + .desc("Port on localhost to check status for") + .build(); + + public static final Option OPTION_SHORT = + Option.builder() + .longOpt("short") + .argName("SHORT") + .required(false) + .desc("Short format. Prints one URL per line for running instances") + .build(); + @Override public List getOptions() { -return List.of( -// The solr-url option is not exposed to the end user, and is -// created by the bin/solr script and passed into this command directly, -// therefore we don't use the SolrCLI.OPTION_SOLRURL. -Option.builder() -.argName("URL") -.longOpt("solr-url") -.hasArg() -.required(false) -.desc("Property set by calling scripts, not meant for user configuration.") -.build(), -OPTION_MAXWAITSECS); +return List.of(OPTION_SOLRURL, OPTION_MAXWAITSECS, OPTION_PORT, OPTION_SHORT); } @Override public void runImpl(CommandLine cli) throws Exception { -// Override the default help behaviour to put out a customized message that only list user -// settable Options. -if ((cli.getOptions().length == 0 && cli.getArgs().length == 0) -|| cli.hasOption("h") -|| cli.hasOption("help")) { - final Options options = new Options(); - options.addOption(OPTION_MAXWAITSECS); - new HelpFormatter().printHelp("status", options); - return; +String solrUrl = cli.getOptionValue(OPTION_SOLRURL); +Integer port = +cli.hasOption(OPTION_PORT) ? Integer.parseInt(cli.getOptionValue(OPTION_PORT)) : null; +boolean shortFormat = cli.hasOption(OPTION_SHORT); +int maxWaitSecs = Integer.parseInt(cli.getOptionValue("max-wait-secs", "0")); + +if (port != null && solrUrl != null) { + throw new IllegalArgumentException("Only one of port or url can be specified"); } -int maxWaitSecs = Integer.parseInt(cli.getOptionValue("max-wait-secs", "0")); -String solrUrl = SolrCLI.normalizeSolrUrl(cli); -if (maxWaitSecs > 0) { - int solrPort = new URI(solrUrl).getPort(); - echo("Waiting up to " + maxWaitSecs + " seconds to see Solr running on port " + solrPort); - try { -waitToSeeSolrUp( -solrUrl, -cli.getOptionValue(SolrCLI.OPTION_CREDENTIALS.getLongOpt()), -maxWaitSecs, -TimeUnit.SECONDS); -echo("Started Solr server on port " + solrPort + ". Happy searching!"); - } catch (TimeoutException timeout) { -throw new Exception( -"Solr at " + solrUrl + " did not come online within " + maxWaitSecs + " seconds!"); +if (solrUrl != null) { + // URL provided, do not consult local processes, as the URL may be remote + if (maxWaitSecs > 0) { +// Used by Windows start script when starting Solr +try { + waitForSolrUpAndPrintStatus(solrUrl, cli, maxWaitSecs); Review Comment: I think that makes sense... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org