Skip to content

Commit

Permalink
pass NODETOOL_NODE_PREFIX to relx-generated script, spare some atoms (#…
Browse files Browse the repository at this point in the history
…1079)

Each time riak status (and the like) is run, relx generates a unique id
which is then converted to an atom ("[email protected]") in
riak VM, eventually causing atom table exhaustion.  Relx has been modified
to optionally generate a static id if NODETOOL_NODE_PREFIX env var is
present.  Convenient when the caller guarantees calls are always
serialized.

Co-authored-by: Andrei Zavada <[email protected]>
  • Loading branch information
hmmr and Andrei Zavada authored Oct 6, 2021
1 parent 1ae2ca8 commit 96ff4d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rel/files/riak
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ else
fi
case "$1" in
start|console|foreground)
su - riak -c "RELX_CONFIG_PATH=${RELX_CONFIG_PATH} VMARGS_PATH=${VMARGS_PATH} RUNNER_LOG_DIR=${RUNNER_LOG_DIR} PIPE_DIR=${PIPE_DIR} ${COMMAND} ${*} -pa {{platform_lib_dir}}/patches"
su - riak -c "NODETOOL_NODE_PREFIX=${NODETOOL_NODE_PREFIX} RELX_CONFIG_PATH=${RELX_CONFIG_PATH} VMARGS_PATH=${VMARGS_PATH} RUNNER_LOG_DIR=${RUNNER_LOG_DIR} PIPE_DIR=${PIPE_DIR} ${COMMAND} ${*} -pa {{platform_lib_dir}}/patches"
;;
debug)
# Drop the "debug" from the args as we're going to directly call riak-debug now
shift
# Debug may fail if run via relx script due to use of relative start location, and also need for root access
RELX_CONFIG_PATH=${RELX_CONFIG_PATH} VMARGS_PATH=${VMARGS_PATH} RUNNER_LOG_DIR=${RUNNER_LOG_DIR} PIPE_DIR=${PIPE_DIR} ${DEBUG_COMMAND} ${*}
NODETOOL_NODE_PREFIX=${NODETOOL_NODE_PREFIX} RELX_CONFIG_PATH=${RELX_CONFIG_PATH} VMARGS_PATH=${VMARGS_PATH} RUNNER_LOG_DIR=${RUNNER_LOG_DIR} PIPE_DIR=${PIPE_DIR} ${DEBUG_COMMAND} ${*}
;;
*)
ESCAPED_ARGS=`echo "$@" | sed -e 's/\([\\\(\\\){}"\x27]\)/\\\\\1/g'`
su - riak -c "RELX_CONFIG_PATH=${RELX_CONFIG_PATH} VMARGS_PATH=${VMARGS_PATH} RUNNER_LOG_DIR=${RUNNER_LOG_DIR} PIPE_DIR=${PIPE_DIR} ${COMMAND} ${ESCAPED_ARGS}"
su - riak -c "NODETOOL_NODE_PREFIX=${NODETOOL_NODE_PREFIX} RELX_CONFIG_PATH=${RELX_CONFIG_PATH} VMARGS_PATH=${VMARGS_PATH} RUNNER_LOG_DIR=${RUNNER_LOG_DIR} PIPE_DIR=${PIPE_DIR} ${COMMAND} ${ESCAPED_ARGS}"
;;
esac
fi
Expand Down

0 comments on commit 96ff4d4

Please sign in to comment.