Permalink
Browse files

Ensure all our beams have different ERL_CRASH_DUMPs.

Change-Id: I9ab9e4df596ac254e2bc8f92878b31a2911be6d1
Reviewed-on: http://review.couchbase.org/34949
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information...
1 parent b7563c0 commit c6a2e6ccb15f5843b5ea688643d37aca1befe693 @aartamonau aartamonau committed with alk Mar 26, 2014
Showing with 26 additions and 4 deletions.
  1. +4 −1 cluster_run
  2. +3 −1 couchbase-server.sh.in
  3. +10 −1 deps/ns_babysitter/src/child_erlang.erl
  4. +9 −1 src/ns_ports_setup.erl
View
@@ -144,7 +144,10 @@ def start_cluster(num_nodes, start_index, host, extra_args, args_prefix):
if not params['env'].has_key('ERL_FULLSWEEP_AFTER'):
params['env']['ERL_FULLSWEEP_AFTER'] = '512'
params['env']['PATH'] = path
- params['env']['ERL_CRASH_DUMP'] = 'erl_crash.dump.n_%d' % i
+
+ crash_dump_base = 'erl_crash.dump.n_%d' % i
+ params['env']['ERL_CRASH_DUMP_BASE'] = crash_dump_base
+ params['env']['ERL_CRASH_DUMP'] = crash_dump_base + '.babysitter'
params['close_fds'] = True
View
@@ -34,7 +34,9 @@ couch_start_arguments=""
LD_LIBRARY_PATH="@PREFIX@/lib":"@PREFIX@/lib/memcached":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
-ERL_CRASH_DUMP=erl_crash.dump.$(date +%s).$$
+ERL_CRASH_DUMP_BASE=erl_crash.dump.$(date +%s).$$
+ERL_CRASH_DUMP=$ERL_CRASH_DUMP_BASE.babysitter
+export ERL_CRASH_DUMP_BASE
export ERL_CRASH_DUMP
ERL_FULLSWEEP_AFTER=512
@@ -55,9 +55,18 @@ open_port_args() ->
AllArgs = ErlangArgs ++ AppArgs,
ErlPath = filename:join([hd(proplists:get_value(root, init:get_arguments())),
"bin", "erl"]),
+
+ Env0 = case os:getenv("ERL_CRASH_DUMP_BASE") of
+ false ->
+ [];
+ Base ->
+ [{"ERL_CRASH_DUMP", Base ++ ".ns_server"}]
+ end,
+ Env = [{"NS_SERVER_BABYSITTER_COOKIE", atom_to_list(erlang:get_cookie())} | Env0],
+
[{spawn_executable, ErlPath},
[{args, AllArgs},
- {env, [{"NS_SERVER_BABYSITTER_COOKIE", atom_to_list(erlang:get_cookie())}]},
+ {env, Env},
exit_status, use_stdio, stream, eof]].
child_start(Arg) ->
View
@@ -119,11 +119,19 @@ create_ssl_proxy_spec(Config) ->
ErlPath = filename:join([hd(proplists:get_value(root, init:get_arguments())),
"bin", "erl"]),
+ Env0 = case os:getenv("ERL_CRASH_DUMP_BASE") of
+ false ->
+ [];
+ Base ->
+ [{"ERL_CRASH_DUMP", Base ++ ".xdcr_proxy"}]
+ end,
+ Env = [{"NS_SSL_PROXY_ENV_ARGS", inspect_term_arg(EnvArgs)} | Env0],
+
{xdcr_proxy,
ErlPath,
AllArgs,
[use_stdio, stderr_to_stdout,
- {env, [{"NS_SSL_PROXY_ENV_ARGS", inspect_term_arg(EnvArgs)}]}]}.
+ {env, Env}]}.
per_bucket_moxi_specs(Config) ->
BucketConfigs = ns_bucket:get_buckets(Config),

0 comments on commit c6a2e6c

Please sign in to comment.