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

bin/solr fails to run on java9 due to unrecognized GC logging options

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.5, 7.0
    • Component/s: scripts and tools
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:

      Description

      hossman@tray:~/lucene/dev/solr [master] $ bin/solr start -f
      Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
      Java HotSpot(TM) 64-Bit Server VM warning: Option UseParNewGC was deprecated in version 9.0 and will likely be removed in a future release.
      Unrecognized VM option 'PrintHeapAtGC'
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.
      

      (untested) workaround is to override GC_LOG_OPTS in solr.in.sh

        Issue Links

          Activity

          Hide
          thetaphi Uwe Schindler added a comment - - edited

          See https://bugs.openjdk.java.net/browse/JDK-8145092 about this. But this is work in progress, as far as I see. Maybe it changes until final release. But we should update all the start scripts to use the new -Xlog options instead of the old ones, if Java 9 was detected.

          Show
          thetaphi Uwe Schindler added a comment - - edited See https://bugs.openjdk.java.net/browse/JDK-8145092 about this. But this is work in progress, as far as I see. Maybe it changes until final release. But we should update all the start scripts to use the new -Xlog options instead of the old ones, if Java 9 was detected.
          Hide
          thetaphi Uwe Schindler added a comment -

          The JEPs for this change are:

          This allows to now centralice all logging to a single command line option.

          Show
          thetaphi Uwe Schindler added a comment - The JEPs for this change are: http://openjdk.java.net/jeps/158 http://openjdk.java.net/jeps/271 This allows to now centralice all logging to a single command line option.
          Hide
          thetaphi Uwe Schindler added a comment -

          Here is a short info how to transfer the old deprecated PrintGCDetails flags to new ones: https://bugs.openjdk.java.net/browse/JDK-8145180

          Show
          thetaphi Uwe Schindler added a comment - Here is a short info how to transfer the old deprecated PrintGCDetails flags to new ones: https://bugs.openjdk.java.net/browse/JDK-8145180
          Hide
          hossman Hoss Man added a comment -

          thanks for the links Uwe, JEP 158 is interesting.

          Between the GC logging options that have been removed, and how the unified logging now deals with multiple tags (gc, all, etc..) & output specifiers (stdout, stderr, for file) in a single '-Xlog' param; it doesn't look viable to have an exact java9 equivilent for what the bin/solr script currently does with SOLR_LOGS_DIR & GC_LOG_OPTS

          The attached patch attempts to support the same ideas as best as (i can see) possible under java9...

          • if the user doesn't configure a GC_LOG_OPTS, then we (still) use a (verbose) default value for this param via '-Xlog:gc*'
          • if the user configures a blank value for GC_LOG_OPTS, we (still) leave the param blank
          • if the effective value of GC_LOG_OPTS is non blank, then foreach param option specified in GC_LOG_OPTS:
            • if it starts with '-Xlog:gc', and does not include an output specifier, then:
              • add a 'file' output specifier based on SOLR_LOGS_DIR (to mimic the '-Xloggc' param we use w/ java8)
              • add time,uptime decorators (to mimic the -XX params we use w/ java8)
              • add filecount=9,filesize=20000 output-options (to mimic the -XX params we use w/ java8)

          (for simplicity, if the user wants to specify multiple JEP158 tags in the '-Xlog' param , then the tag list has to start with "gc" in order for us to add a file option – otherwise we ignore it. likewise if the user wants to specify their own decorators or output-options, then they must also specify their own output (file, or stdout, or stderr) specifier as well, since it must come first in the '-Xlog' format string)

          While fixing this, I also did some small cleanup in how the java -version output is parsed.

          Would appreciate detailed review & manual testing from folks since this type of script work is hard to write automated tests for.

          Show
          hossman Hoss Man added a comment - thanks for the links Uwe, JEP 158 is interesting. Between the GC logging options that have been removed, and how the unified logging now deals with multiple tags (gc, all, etc..) & output specifiers (stdout, stderr, for file) in a single '-Xlog' param; it doesn't look viable to have an exact java9 equivilent for what the bin/solr script currently does with SOLR_LOGS_DIR & GC_LOG_OPTS The attached patch attempts to support the same ideas as best as (i can see) possible under java9... if the user doesn't configure a GC_LOG_OPTS , then we (still) use a (verbose) default value for this param via '-Xlog:gc*' if the user configures a blank value for GC_LOG_OPTS , we (still) leave the param blank if the effective value of GC_LOG_OPTS is non blank, then foreach param option specified in GC_LOG_OPTS : if it starts with '-Xlog:gc', and does not include an output specifier, then: add a 'file' output specifier based on SOLR_LOGS_DIR (to mimic the '-Xloggc' param we use w/ java8) add time,uptime decorators (to mimic the -XX params we use w/ java8) add filecount=9,filesize=20000 output-options (to mimic the -XX params we use w/ java8) (for simplicity, if the user wants to specify multiple JEP158 tags in the '-Xlog' param , then the tag list has to start with "gc" in order for us to add a file option – otherwise we ignore it. likewise if the user wants to specify their own decorators or output-options, then they must also specify their own output (file, or stdout, or stderr) specifier as well, since it must come first in the '-Xlog' format string) While fixing this, I also did some small cleanup in how the java -version output is parsed. Would appreciate detailed review & manual testing from folks since this type of script work is hard to write automated tests for.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 90fa23cad82a29a5553a350f70be358830acb74c in lucene-solr's branch refs/heads/branch_6x from Chris Hostetter
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=90fa23c ]

          SOLR-10184: Fix bin/solr so it can run properly on java9

          (cherry picked from commit 09bd8612ce82c2852542127eb24b887c7b332a0d)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 90fa23cad82a29a5553a350f70be358830acb74c in lucene-solr's branch refs/heads/branch_6x from Chris Hostetter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=90fa23c ] SOLR-10184 : Fix bin/solr so it can run properly on java9 (cherry picked from commit 09bd8612ce82c2852542127eb24b887c7b332a0d)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 09bd8612ce82c2852542127eb24b887c7b332a0d in lucene-solr's branch refs/heads/master from Chris Hostetter
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=09bd861 ]

          SOLR-10184: Fix bin/solr so it can run properly on java9

          Show
          jira-bot ASF subversion and git services added a comment - Commit 09bd8612ce82c2852542127eb24b887c7b332a0d in lucene-solr's branch refs/heads/master from Chris Hostetter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=09bd861 ] SOLR-10184 : Fix bin/solr so it can run properly on java9
          Hide
          janhoy Jan Høydahl added a comment -

          This issue did not fix solr.cmd script, so running on Windows and Java9 will most likely break? Open a new Jira?

          Show
          janhoy Jan Høydahl added a comment - This issue did not fix solr.cmd script, so running on Windows and Java9 will most likely break? Open a new Jira?
          Hide
          thetaphi Uwe Schindler added a comment -

          Yeah, that's right. Be also sure to test Java 9 build 175, which is the first release candidate. Without any "ea" strings in version anymore. Version is now just plain "9" without dots, nothing.

          Show
          thetaphi Uwe Schindler added a comment - Yeah, that's right. Be also sure to test Java 9 build 175, which is the first release candidate. Without any "ea" strings in version anymore. Version is now just plain "9" without dots, nothing.
          Hide
          hossman Hoss Man added a comment -

          Open a new Jira?

          no. SOLR-8689 (already linked) tracks issues with solr.cmd on java9. see comments there.

          Show
          hossman Hoss Man added a comment - Open a new Jira? no. SOLR-8689 (already linked) tracks issues with solr.cmd on java9. see comments there.

            People

            • Assignee:
              hossman Hoss Man
              Reporter:
              hossman Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development