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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]