You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/02/02 14:25:07 UTC
[GitHub] [solr] NazerkeBS opened a new pull request #589: SOLR-15124: Fix ThreadDumpHandlerTest
NazerkeBS opened a new pull request #589:
URL: https://github.com/apache/solr/pull/589
https://issues.apache.org/jira/browse/SOLR-15124
<!--
_(If you are a project committer then you may remove some/all of the following template.)_
Before creating a pull request, please file an issue in the ASF Jira system for Solr:
* https://issues.apache.org/jira/projects/SOLR
You will need to create an account in Jira in order to create an issue.
The title of the PR should reference the Jira issue number in the form:
* SOLR-####: <short description of problem or changes>
SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
# Description
Please provide a short description of the changes you're making with this pull request.
# Solution
Please provide a short description of the approach taken to implement your solution.
# Tests
Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.
# Checklist
Please review the following and check all that apply:
- [ ] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) 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](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
- [ ] 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](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
--
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-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
[GitHub] [solr] dsmiley commented on a change in pull request #589: SOLR-15124: Fix ThreadDumpHandlerTest
Posted by GitBox <gi...@apache.org>.
dsmiley commented on a change in pull request #589:
URL: https://github.com/apache/solr/pull/589#discussion_r799811504
##########
File path: solr/core/src/test/org/apache/solr/handler/admin/ThreadDumpHandlerTest.java
##########
@@ -245,21 +253,18 @@ public void doTestOwnableSync(final boolean checkWaitingThreadViaPolling) throws
}
}
- @SuppressWarnings({"unchecked"})
- private NamedList<Object> readProperties() throws Exception {
+ private void request(String path, Consumer<NamedList<?>> consumer) throws Exception {
SolrClient client = new EmbeddedSolrServer(h.getCore());
-
- NamedList<Object> properties = client.request(new GenericSolrRequest(SolrRequest.METHOD.GET, "/admin/info/threads",
- new ModifiableSolrParams()));
- return properties;
+ ModifiableSolrParams mparams = new ModifiableSolrParams();
+ mparams.set("indent", true);
+ NamedList<?> rsp = client.request(new GenericSolrRequest(SolrRequest.METHOD.GET, path, mparams));
+ consumer.accept(rsp);
}
- @SuppressWarnings({"unchecked"})
- private NamedList<Object> getThread(NamedList<Object> threads, String threadName) {
- for (Map.Entry<String, Object> threadEntry : threads) {
- @SuppressWarnings({"unchecked"})
- NamedList<Object> thread = (NamedList<Object>) threadEntry.getValue();
- if (thread._getStr("name", null).contains(threadName)) {
+ private NamedList<?> getThreadInfo(NamedList<?> req, String threadName) {
+ for (Map.Entry<String, ?> threadInfoEntry : (NamedList<?>) req._get("system/threadDump", null)) {
Review comment:
```suggestion
private NamedList<?> getThreadInfo(NamedList<?> rsp, String threadName) {
for (Map.Entry<String, ?> threadInfoEntry : (NamedList<?>) rsp._get("system/threadDump", null)) {
```
--
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-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
[GitHub] [solr] dsmiley merged pull request #589: SOLR-15124: Fix ThreadDumpHandlerTest
Posted by GitBox <gi...@apache.org>.
dsmiley merged pull request #589:
URL: https://github.com/apache/solr/pull/589
--
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-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
[GitHub] [solr] NazerkeBS commented on a change in pull request #589: SOLR-15124: Fix ThreadDumpHandlerTest
Posted by GitBox <gi...@apache.org>.
NazerkeBS commented on a change in pull request #589:
URL: https://github.com/apache/solr/pull/589#discussion_r797827819
##########
File path: solr/core/src/test/org/apache/solr/handler/admin/ThreadDumpHandlerTest.java
##########
@@ -245,21 +253,18 @@ public void doTestOwnableSync(final boolean checkWaitingThreadViaPolling) throws
}
}
- @SuppressWarnings({"unchecked"})
- private NamedList<Object> readProperties() throws Exception {
+ private void request(String path, Consumer<NamedList<?>> consumer) throws Exception {
SolrClient client = new EmbeddedSolrServer(h.getCore());
-
- NamedList<Object> properties = client.request(new GenericSolrRequest(SolrRequest.METHOD.GET, "/admin/info/threads",
- new ModifiableSolrParams()));
- return properties;
+ ModifiableSolrParams mparams = new ModifiableSolrParams();
+ mparams.set("indent", true);
+ NamedList<?> req = client.request(new GenericSolrRequest(SolrRequest.METHOD.GET, path, mparams));
Review comment:
yess, it should be response
--
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-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
[GitHub] [solr] madrob commented on a change in pull request #589: SOLR-15124: Fix ThreadDumpHandlerTest
Posted by GitBox <gi...@apache.org>.
madrob commented on a change in pull request #589:
URL: https://github.com/apache/solr/pull/589#discussion_r797773801
##########
File path: solr/core/src/test/org/apache/solr/handler/admin/ThreadDumpHandlerTest.java
##########
@@ -245,21 +253,18 @@ public void doTestOwnableSync(final boolean checkWaitingThreadViaPolling) throws
}
}
- @SuppressWarnings({"unchecked"})
- private NamedList<Object> readProperties() throws Exception {
+ private void request(String path, Consumer<NamedList<?>> consumer) throws Exception {
SolrClient client = new EmbeddedSolrServer(h.getCore());
-
- NamedList<Object> properties = client.request(new GenericSolrRequest(SolrRequest.METHOD.GET, "/admin/info/threads",
- new ModifiableSolrParams()));
- return properties;
+ ModifiableSolrParams mparams = new ModifiableSolrParams();
+ mparams.set("indent", true);
+ NamedList<?> req = client.request(new GenericSolrRequest(SolrRequest.METHOD.GET, path, mparams));
Review comment:
nit: would this be response, not request?
--
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-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
[GitHub] [solr] dsmiley commented on a change in pull request #589: SOLR-15124: Fix ThreadDumpHandlerTest
Posted by GitBox <gi...@apache.org>.
dsmiley commented on a change in pull request #589:
URL: https://github.com/apache/solr/pull/589#discussion_r798903074
##########
File path: solr/core/src/test/org/apache/solr/handler/admin/ThreadDumpHandlerTest.java
##########
@@ -245,21 +253,18 @@ public void doTestOwnableSync(final boolean checkWaitingThreadViaPolling) throws
}
}
- @SuppressWarnings({"unchecked"})
- private NamedList<Object> readProperties() throws Exception {
+ private void request(String path, Consumer<NamedList<?>> consumer) throws Exception {
SolrClient client = new EmbeddedSolrServer(h.getCore());
-
- NamedList<Object> properties = client.request(new GenericSolrRequest(SolrRequest.METHOD.GET, "/admin/info/threads",
- new ModifiableSolrParams()));
- return properties;
+ ModifiableSolrParams mparams = new ModifiableSolrParams();
+ mparams.set("indent", true);
+ NamedList<?> rsp = client.request(new GenericSolrRequest(SolrRequest.METHOD.GET, path, mparams));
+ consumer.accept(rsp);
}
- @SuppressWarnings({"unchecked"})
- private NamedList<Object> getThread(NamedList<Object> threads, String threadName) {
- for (Map.Entry<String, Object> threadEntry : threads) {
- @SuppressWarnings({"unchecked"})
- NamedList<Object> thread = (NamedList<Object>) threadEntry.getValue();
- if (thread._getStr("name", null).contains(threadName)) {
+ private NamedList<?> getThreadInfo(NamedList<?> req, String threadName) {
Review comment:
The first arg is the *response* not a *request*
--
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-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org