Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-12776

Setting of TMP in solr.cmd causes invisibility of Solr to JDK tools

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 7.6, 8.0
    • Component/s: scripts and tools
    • Labels:
      None
    • Environment:

      Windows. Tested with Java 8u152 and Solr 6.3.0.

      Description

      (issue firstly discussed in here: http://mail-archives.apache.org/mod_mbox/lucene-solr-user/201809.mbox/%3C20180916154315.0922A29C@centrum.cz%3E)

      Please notice the following lines added (among others) to "solr.cmd" by commit https://github.com/apache/lucene-solr/commit/b36c68b16e67ae701cefce052a4fdbaac88fb65c for https://issues.apache.org/jira/browse/SOLR-6833 about 4 years ago (v5.0):

      set TMP=!SOLR_HOME:%EXAMPLE_DIR%=!
      IF NOT "%TMP%"=="%SOLR_HOME%" (
        set "SOLR_LOGS_DIR=%SOLR_HOME%\..\logs"
        set "LOG4J_CONFIG=file:%EXAMPLE_DIR%\resources\log4j.properties"
      )

      Apparently, the new variable "TMP" is just a temporary one, but by coincidence, this variable is also important for JVM. As this system variable tells where the "hsperfdata_<username>" directory for storing applications' monitoring data should be located. And if this is changed, JDK tools like JVisualVM, jps and others won't locally see the given Java application, because they search in a different default location.

      Proposed solution

      A working solution seems to be just to rename the TMP variable to for example TMP1 as in the attached simple-rename-fix.patch. Maybe even a simple "==" comparison of SOLR_HOME and EXAMPLE_DIR could (should?) be made, but I don't have enough time to study and test this scenario.

        Attachments

        1. SOLR-12776.patch
          0.5 kB
          Erick Erickson
        2. SOLR-12776.patch
          1.0 kB
          Erick Erickson
        3. SOLR-12776.patch
          1.0 kB
          Erick Erickson
        4. simple-rename-fix.patch
          0.5 kB
          Petr Bodnar

          Activity

            People

            • Assignee:
              erickerickson Erick Erickson
              Reporter:
              pbodnar Petr Bodnar
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: