Skip to content

Commit

Permalink
Merge bug26043
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon MacMullen committed Mar 14, 2014
2 parents fb40d4b + 0751818 commit 20b3190
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
2 changes: 2 additions & 0 deletions scripts/rabbitmq-server
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ case "$(uname -s)" in
fi
esac

export RABBITMQ_CONFIG_FILE

RABBITMQ_EBIN_ROOT="${RABBITMQ_HOME}/ebin"
if ! ${ERL_DIR}erl -pa "$RABBITMQ_EBIN_ROOT" \
-boot "${CLEAN_BOOT_FILE}" \
Expand Down
12 changes: 8 additions & 4 deletions src/rabbit.erl
Original file line number Diff line number Diff line change
Expand Up @@ -776,11 +776,15 @@ home_dir() ->
end.

config_files() ->
Abs = fun (F) ->
filename:absname(filename:rootname(F, ".config") ++ ".config")
end,
case init:get_argument(config) of
{ok, Files} -> [filename:absname(
filename:rootname(File, ".config") ++ ".config") ||
[File] <- Files];
error -> []
{ok, Files} -> [Abs(File) || [File] <- Files];
error -> case os:getenv("RABBITMQ_CONFIG_FILE") of
false -> [];
File -> [Abs(File) ++ " (not found)"]
end
end.

%% We don't want this in fhc since it references rabbit stuff. And we can't put
Expand Down
7 changes: 5 additions & 2 deletions src/rabbit_msg_store.erl
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ handle_call({new_client_state, CRef, CPid, MsgOnDiskFun, CloseFDsFun}, _From,
clients = Clients,
gc_pid = GCPid }) ->
Clients1 = dict:store(CRef, {CPid, MsgOnDiskFun, CloseFDsFun}, Clients),
erlang:monitor(process, CPid),
reply({IndexState, IndexModule, Dir, GCPid, FileHandlesEts, FileSummaryEts,
CurFileCacheEts, FlyingEts},
State #msstate { clients = Clients1 });
Expand All @@ -804,8 +805,6 @@ handle_cast({client_dying, CRef},

handle_cast({client_delete, CRef},
State = #msstate { clients = Clients }) ->
{CPid, _, _} = dict:fetch(CRef, Clients),
credit_flow:peer_down(CPid),
State1 = State #msstate { clients = dict:erase(CRef, Clients) },
noreply(remove_message(CRef, CRef, clear_client(CRef, State1)));

Expand Down Expand Up @@ -888,6 +887,10 @@ handle_info(sync, State) ->
handle_info(timeout, State) ->
noreply(internal_sync(State));

handle_info({'DOWN', _MRef, process, Pid, _Reason}, State) ->
credit_flow:peer_down(Pid),
noreply(State);

handle_info({'EXIT', _Pid, Reason}, State) ->
{stop, Reason, State}.

Expand Down
7 changes: 4 additions & 3 deletions src/rabbit_node_monitor.erl
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,10 @@ handle_dead_node(Node, State = #state{autoheal = Autoheal}) ->
case application:get_env(rabbit, cluster_partition_handling) of
{ok, pause_minority} ->
case majority() of
true -> State;
false -> await_cluster_recovery() %% Does not really return
end;
true -> ok;
false -> await_cluster_recovery()
end,
State;
{ok, ignore} ->
State;
{ok, autoheal} ->
Expand Down

0 comments on commit 20b3190

Please sign in to comment.