Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-16644: Fixing the entropy warning threshold using scaling based on poolsize (closes #1842)

Ishan Chattopadhyaya943395e8c1b8
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index cb46073b65e..cc7d9a46059 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -223,6 +223,8 @@ Bug Fixes
* SOLR-16992: Non-reproducible StreamingTest failures -- suggests CloudSolrStream concurency race condition (Alex Deparvu, hossman)
+* SOLR-16644: Fixing the entropy warning threshold using scaling based on poolsize (Raghavan Muthuregunathan)
+
Dependency Upgrades
---------------------
diff --git a/solr/bin/solr b/solr/bin/solr
index d0d54eae3bf..101fde35a51 100644
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -1915,30 +1915,25 @@ function start_solr() {
-jar start.jar "${SOLR_JETTY_CONFIG[@]}" $SOLR_JETTY_ADDL_CONFIG \
1>"$SOLR_LOGS_DIR/solr-$SOLR_PORT-console.log" 2>&1 & echo $! > "$SOLR_PID_DIR/solr-$SOLR_PORT.pid"
- #!/bin/bash
-
-# Get the current entropy available
-entropy_avail=$(cat /proc/sys/kernel/random/entropy_avail)
-
-# Get the pool size
-pool_size=$(cat /proc/sys/kernel/random/poolsize)
-
-# Check if entropy is available and pool size is non-zero
-if [[ $entropy_avail -gt 0 && $pool_size -ne 0 ]]; then
- # Compute the ratio of entropy available to pool size
- ratio=$(awk -v ea="$entropy_avail" -v ps="$pool_size" 'BEGIN {print (ea/ps)*100}')
-
- # Check if the ratio is less than 25%
- if (( $(echo "$ratio < 25" | bc -l) )); then
- echo "Warning: Available entropy is low. As a result, use of the UUIDField, SSL, or any other features that require"
- echo "RNG might not work properly. To check for the amount of available entropy, use 'cat /proc/sys/kernel/random/entropy_avail'."
+ # Get the current entropy available
+ entropy_avail=$(cat /proc/sys/kernel/random/entropy_avail)
+
+ # Get the pool size
+ pool_size=$(cat /proc/sys/kernel/random/poolsize)
+
+ # Check if entropy is available and pool size is non-zero
+ if [[ $entropy_avail -gt 0 && $pool_size -ne 0 ]]; then
+ # Compute the ratio of entropy available to pool size
+ ratio=$(awk -v ea="$entropy_avail" -v ps="$pool_size" 'BEGIN {print (ea/ps)*100}')
+
+ # Check if the ratio is less than 25%
+ if (( $(echo "$ratio < 25" | bc -l) )); then
+ echo "Warning: Available entropy is low. As a result, use of the UUIDField, SSL, or any other features that require"
+ echo "RNG might not work properly. To check for the amount of available entropy, use 'cat /proc/sys/kernel/random/entropy_avail'."
+ fi
+ else
+ echo "Error: Either no entropy is available or the pool size is zero."
fi
-else
- echo "Error: Either no entropy is available or the pool size is zero."
-fi
-
-
-
# no lsof on cygwin though
if lsof -v 2>&1 | grep -q revision; then