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/02/02 09:00:34 UTC

[GitHub] [lucene-solr] cpoerschke commented on a change in pull request #2284: SOLR-11233: Add optional JAVA8_GC_LOG_FILE_OPTS for bin/solr.

cpoerschke commented on a change in pull request #2284:
URL: https://github.com/apache/lucene-solr/pull/2284#discussion_r568428808



##########
File path: solr/bin/solr
##########
@@ -2026,7 +2026,11 @@ if [ "$GC_LOG_OPTS" != "" ]; then
     if [ "$JAVA_VENDOR" == "IBM J9" ]; then
       gc_log_flag="-Xverbosegclog"
     fi
-    GC_LOG_OPTS+=("$gc_log_flag:$SOLR_LOGS_DIR/solr_gc.log" '-XX:+UseGCLogFileRotation' '-XX:NumberOfGCLogFiles=9' '-XX:GCLogFileSize=20M')
+    if [ -z ${JAVA8_GC_LOG_FILE_OPTS+x} ]; then

Review comment:
       This variant is consistent with the existing variant at line 2010 but yes it confused me too when I first read it, looks there's a subtle difference between "unset" and "set to empty string" behaviour. Illustration:
   
   ```
   $ unset GC_LOG_OPTS
   $ if [ -z ${GC_LOG_OPTS+x} ]; then echo unset; else echo not unset; fi
   unset
   $ if [ -z ${GC_LOG_OPTS:+x} ]; then echo empty; else echo not empty; fi
   empty
   $ if [ -z ${GC_LOG_OPTS} ]; then echo empty; else echo not empty; fi
   empty
   $ 
   $ GC_LOG_OPTS=
   $ if [ -z ${GC_LOG_OPTS+x} ]; then echo unset; else echo not unset; fi
   not unset
   $ if [ -z ${GC_LOG_OPTS:+x} ]; then echo empty; else echo not empty; fi
   empty
   $ if [ -z ${GC_LOG_OPTS} ]; then echo empty; else echo not empty; fi
   empty
   $
   $ GC_LOG_OPTS=foobar
   $ if [ -z ${GC_LOG_OPTS+x} ]; then echo unset; else echo not unset; fi
   not unset
   $ if [ -z ${GC_LOG_OPTS:+x} ]; then echo empty; else echo not empty; fi
   not empty
   $ if [ -z ${GC_LOG_OPTS} ]; then echo empty; else echo not empty; fi
   not empty
   ```




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