Apache Lucene open-source search software
SOLR-12192: Error when ulimit is unlimited
Erick Ericksonabb57c5c8166
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 8b443f77556..5e56af00813 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -223,6 +223,8 @@ Bug FixesMiniSolrCloudCluster.deleteAllCollections will now first delete aliases since a collection cannot be deleted if analias refers to it. (David Smiley)+* SOLR-12192: Fixed a solr cli error message when ulimits are unlimited. (Martijn Koster)+Optimizations----------------------diff --git a/solr/bin/solr b/solr/bin/solrindex 68d1140df6b..53cf84de066 100755--- a/solr/bin/solr+++ b/solr/bin/solr@@ -1455,13 +1455,13 @@ if [ -z "$SOLR_ULIMIT_CHECKS" ] || [ "$SOLR_ULIMIT_CHECKS" != "false" ]; thenif hash ulimit 2>/dev/null; thenopenFiles=$(ulimit -n)maxProcs=$(ulimit -u)- if [ $openFiles -lt "$SOLR_RECOMMENDED_OPEN_FILES" ]; then+ if [ $openFiles != "unlimited" ] && [ $openFiles -lt "$SOLR_RECOMMENDED_OPEN_FILES" ]; thenecho "*** [WARN] *** Your open file limit is currently $openFiles. "echo " It should be set to $SOLR_RECOMMENDED_OPEN_FILES to avoid operational disruption. "echo " If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh"fi- if [ $maxProcs -lt "$SOLR_RECOMMENDED_MAX_PROCESSES" ]; then+ if [ $maxProcs != "unlimited" ] && [ $maxProcs -lt "$SOLR_RECOMMENDED_MAX_PROCESSES" ]; thenecho "*** [WARN] *** Your Max Processes Limit is currently $maxProcs. "echo " It should be set to $SOLR_RECOMMENDED_MAX_PROCESSES to avoid operational disruption. "echo " If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh"