You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by is...@apache.org on 2023/09/29 17:27:54 UTC

[solr] branch main updated (f0fcd300c89 -> 943395e8c1b)

This is an automated email from the ASF dual-hosted git repository.

ishan pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


    from f0fcd300c89 SOLR-16992 Non-reproducible StreamingTest failures (#1955)
     new 0f7e067f916 SOLR-16644 Fixing the entropy warning threshold based on OS ubuntu and the kernel version
     new df3ff50085b SOLR-16644: Updating the check based on ratio
     new 943395e8c1b SOLR-16644: Fixing the entropy warning threshold using scaling based on poolsize (closes #1842)

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 solr/CHANGES.txt |  2 ++
 solr/bin/solr    | 24 +++++++++++++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)


[solr] 02/03: SOLR-16644: Updating the check based on ratio

Posted by is...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ishan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git

commit df3ff50085b18af3007e0c6e858bd244fd2ee480
Author: Raghavan Muthuregunathan <ra...@gmail.com>
AuthorDate: Wed Sep 27 00:15:04 2023 -0700

    SOLR-16644: Updating the check based on ratio
---
 solr/bin/solr | 37 ++++++++++++++++++++-----------------
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git a/solr/bin/solr b/solr/bin/solr
index 9f2c858ac79..d0d54eae3bf 100644
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -1915,27 +1915,30 @@ 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"
 
-  entropy_threshold=300
-  # Determine if the operating system is Ubuntu
-  os_name=$(lsb_release -is)
-  if [[ "$os_name" == "Ubuntu" ]]; then
-    # Get the kernel version
-    kernel_version=$(uname -r | awk -F. '{print $1"."$2}')
-    # Set entropy threshold based on kernel version
-    if [[ $(echo "$kernel_version >= 5.15" | bc) -eq 1 ]]; then
-      # For kernels 5.15 and newer
-      entropy_threshold=64  # Adjusted for 256 pool size (approx 25% of 256)
-    else
-      # For older kernels
-      entropy_threshold=300  # Original threshold for 4096 pool size
-    fi
-  fi
+  #!/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 entropy and display warning if below threshold
-    if [[ -f /proc/sys/kernel/random/entropy_avail ]] && (( $(cat /proc/sys/kernel/random/entropy_avail) < $entropy_threshold)); then
+# 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
+
+
+ 
 
     # no lsof on cygwin though
     if lsof -v 2>&1 | grep -q revision; then


[solr] 03/03: SOLR-16644: Fixing the entropy warning threshold using scaling based on poolsize (closes #1842)

Posted by is...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ishan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 943395e8c1b8787ce19e1270891634bde5a7e62f
Author: Ishan Chattopadhyaya <is...@apache.org>
AuthorDate: Fri Sep 29 22:54:43 2023 +0530

    SOLR-16644: Fixing the entropy warning threshold using scaling based on poolsize (closes #1842)
---
 solr/CHANGES.txt |  2 ++
 solr/bin/solr    | 41 ++++++++++++++++++-----------------------
 2 files changed, 20 insertions(+), 23 deletions(-)

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


[solr] 01/03: SOLR-16644 Fixing the entropy warning threshold based on OS ubuntu and the kernel version

Posted by is...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ishan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 0f7e067f916f49f4094f74c63512cd0accf9e2ca
Author: Raghavan Muthuregunathan <ra...@gmail.com>
AuthorDate: Tue Aug 15 01:42:51 2023 -0700

    SOLR-16644 Fixing the entropy warning threshold based on OS ubuntu and the kernel version
---
 solr/bin/solr | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/solr/bin/solr b/solr/bin/solr
index cc72f621094..9f2c858ac79 100644
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -1915,12 +1915,28 @@ 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"
 
-    # check if /proc/sys/kernel/random/entropy_avail exists then check output of cat /proc/sys/kernel/random/entropy_avail to see if less than 300
-    if [[ -f /proc/sys/kernel/random/entropy_avail ]] && (( $(cat /proc/sys/kernel/random/entropy_avail) < 300)); 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'."
-	echo ""
+  entropy_threshold=300
+  # Determine if the operating system is Ubuntu
+  os_name=$(lsb_release -is)
+  if [[ "$os_name" == "Ubuntu" ]]; then
+    # Get the kernel version
+    kernel_version=$(uname -r | awk -F. '{print $1"."$2}')
+    # Set entropy threshold based on kernel version
+    if [[ $(echo "$kernel_version >= 5.15" | bc) -eq 1 ]]; then
+      # For kernels 5.15 and newer
+      entropy_threshold=64  # Adjusted for 256 pool size (approx 25% of 256)
+    else
+      # For older kernels
+      entropy_threshold=300  # Original threshold for 4096 pool size
     fi
+  fi
+
+        # Check entropy and display warning if below threshold
+    if [[ -f /proc/sys/kernel/random/entropy_avail ]] && (( $(cat /proc/sys/kernel/random/entropy_avail) < $entropy_threshold)); 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
+
     # no lsof on cygwin though
     if lsof -v 2>&1 | grep -q revision; then
       echo -n "Waiting up to $SOLR_START_WAIT seconds to see Solr running on port $SOLR_PORT"