You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2022/06/09 19:20:56 UTC

[pulsar] branch master updated: Allow PULSAR_MEM & PULSAR_GC to be Overridden in pulsar_tool_env.sh (#15868)

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

mmarshall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new fa6288e87ec Allow PULSAR_MEM & PULSAR_GC to be Overridden in pulsar_tool_env.sh (#15868)
fa6288e87ec is described below

commit fa6288e87ec557e99a65131a48ee1f1e6a46781f
Author: Jim Baugh <ja...@gmail.com>
AuthorDate: Thu Jun 9 13:20:49 2022 -0600

    Allow PULSAR_MEM & PULSAR_GC to be Overridden in pulsar_tool_env.sh (#15868)
    
    The pulsar_tool_env.sh sets the PULSAR_MEM and PULSAR_GC environment variables without allowing them to be overridden.
    This change keps the default values but allows PULSAR_MEM & PULSAR_GC to be overridden which aligns with the
    pulsar_env.sh file. This allows adjustments to be made to the memory settings when more memory is needed.
    
    Co-authored-by: Jim Baugh <ji...@oracle.com>
    
    ### Motivation
    The pulsar_tool_env.sh sets the PULSAR_MEM environment variable without allowing it to be overridden. When running an pulsar-admin function (e.g. running the kafka to pulsar connector) we can hit java memory issues without a way to change the memory settings. This PR resolves this issue.
    
    ### Modifications
    This change keeps the default value but allows PULSAR_MEM to be overridden which aligns with the
    pulsar_env.sh file. This allows adjustments to be made to the memory settings when more memory is needed.
    
    ### Verifying this change
    
    This change is a trivial rework / code cleanup without any test coverage.
    
    ### Does this pull request potentially affect one of the following parts:
    
    *If `yes` was chosen, please highlight the changes*
    
      - Dependencies (does it add or upgrade a dependency): (no)
      - The public API: (no)
      - The schema: (no)
      - The default values of configurations: (no)
      - The wire protocol: (no)
      - The rest endpoints: (no)
      - The admin cli options: (no)
      - Anything that affects deployment: (no)
    
    ### Documentation
    
    Check the box below or label this PR directly.
    
    Need to update docs?
    - [X] `doc-not-needed`
    (Please explain why)
    There is not currently documentation around the pulsar_tools_env.sh PULSAR_MEM setting. This change doesn't change the default behavior.
---
 conf/pulsar_tools_env.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/conf/pulsar_tools_env.sh b/conf/pulsar_tools_env.sh
index f16bbca7365..a356dbb9a28 100755
--- a/conf/pulsar_tools_env.sh
+++ b/conf/pulsar_tools_env.sh
@@ -42,10 +42,10 @@
 # PULSAR_GLOBAL_ZK_CONF=
 
 # Extra options to be passed to the jvm
-PULSAR_MEM="-Xmx128m -XX:MaxDirectMemorySize=128m"
+PULSAR_MEM=${PULSAR_MEM:-"-Xmx128m -XX:MaxDirectMemorySize=128m"}
 
 # Garbage collection options
-PULSAR_GC=" -client "
+PULSAR_GC=${PULSAR_GC:-" -client "}
 
 # Extra options to be passed to the jvm
 PULSAR_EXTRA_OPTS="${PULSAR_MEM} ${PULSAR_GC} ${PULSAR_GC_LOG} -Dio.netty.leakDetectionLevel=disabled ${PULSAR_EXTRA_OPTS}"