Skip to content

Commit

Permalink
Allow PULSAR_MEM & PULSAR_GC to be Overridden in pulsar_tool_env.sh (#…
Browse files Browse the repository at this point in the history
…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 <jim.baugh@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.
  • Loading branch information
jabbaugh committed Jun 9, 2022
1 parent 278c40f commit fa6288e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conf/pulsar_tools_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit fa6288e

Please sign in to comment.