You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/01/08 22:20:29 UTC

[GitHub] [lucene-solr] epugh opened a new pull request #2192: SOLR-15010 Try to use jattach for threaddump if jstack is missing

epugh opened a new pull request #2192:
URL: https://github.com/apache/lucene-solr/pull/2192


   Introduce jattach check if jstack is missing.  jattach ships in the Solr docker image instead of jstack.
   
   <!--
   _(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 Lucene or Solr:
   
   * https://issues.apache.org/jira/projects/LUCENE
   * 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:
   
   * LUCENE-####: <short description of problem or changes>
   * SOLR-####: <short description of problem or changes>
   
   LUCENE and 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
   
   With the Solr Docker image you get an alarming message about jstack being missing, and meanwhile we have jattach installed in our Docker image, so lets use that if we need to kill Solr.
   
   # Solution
   
   Checks if jattach exits, and adds it as a command, and then if jstack is missing, runs the jattach threaddump command.
   
   # Tests
   
   Hard to test!   I tweaked the bin/solr command to not actually shut solr down, in order to trigger the thread dump, then tested by building the Solr 9 Docker image, and issuing to the image called `solr3`:
   ```
   docker exec solr3 solr stop -p 8983
   Sending stop command to Solr running on port 8983 ... waiting up to 180 seconds to allow Jetty process 16 to stop gracefully.
   Solr process 16 is still running; jattach threaddumping it now.
   Connected to remote JVM
   Response code = 0
   2021-01-08 22:01:34
   Full thread dump OpenJDK 64-Bit Server VM (11.0.9.1+1 mixed mode):
   ```
   
   I then tested it with jstack by running it locally, but with the same commented out code and it worked, and then finally restored the commented out code and the start/stop cycle worked.
   
   I did NOT change anything for Windows.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [ X] 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.
   - [ X] I have created a Jira issue and added the issue ID to my pull request title.
   - [ X] 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)
   - [ X] I have developed this patch against the `master` branch.
   - [ X] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   - [ ] I have added documentation for the [Ref Guide](https://github.com/apache/lucene-solr/tree/master/solr/solr-ref-guide) (for Solr changes only).
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] cpoerschke commented on a change in pull request #2192: SOLR-15010 Try to use jattach for threaddump if jstack is missing

Posted by GitBox <gi...@apache.org>.
cpoerschke commented on a change in pull request #2192:
URL: https://github.com/apache/lucene-solr/pull/2192#discussion_r555071923



##########
File path: solr/bin/solr
##########
@@ -110,9 +110,10 @@ elif [ -n "$JAVA_HOME" ]; then
       JAVA="$java/java"
       if [ -x "$java/jstack" ]; then
         JSTACK="$java/jstack"
+      elif [ -x "$(command -v jattach)" ]; then
+        JATTACH="jattach"

Review comment:
       minor/maybe suggestion:
   ```suggestion
           JATTACH="$(command -v jattach)"
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dsmiley commented on pull request #2192: SOLR-15010 Try to use jattach for threaddump if jstack is missing

Posted by GitBox <gi...@apache.org>.
dsmiley commented on pull request #2192:
URL: https://github.com/apache/lucene-solr/pull/2192#issuecomment-757330086


   Thanks Eric!


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] epugh merged pull request #2192: SOLR-15010 Try to use jattach for threaddump if jstack is missing

Posted by GitBox <gi...@apache.org>.
epugh merged pull request #2192:
URL: https://github.com/apache/lucene-solr/pull/2192


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dsmiley commented on pull request #2192: SOLR-15010 Try to use jattach for threaddump if jstack is missing

Posted by GitBox <gi...@apache.org>.
dsmiley commented on pull request #2192:
URL: https://github.com/apache/lucene-solr/pull/2192#issuecomment-757330086


   Thanks Eric!


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org