Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid spurious HTTP 400 after GET to /_status #528

Merged
merged 1 commit into from
Sep 21, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/oc_erchef/apps/oc_chef_wm/src/chef_wm_status.erl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ check_health_worker(Mod, Parent, Timeout) ->
%% format and converts 'pang' to 'fail' for easier reading.
-spec gather_health_workers([{{pid(), reference()}, atom()}],
[{binary(), binary()}]) -> [{binary(), binary()}].
gather_health_workers([{{Pid, _}, Mod} | Rest] = List, Acc) ->
gather_health_workers([{{Pid, Ref}, Mod} | Rest] = List, Acc) ->
%% Each worker is allotted `ping_timeout()' time to complete its check and report back
%% to this process. We should always get a reply within this window since either the
%% worker will send a result, trigger a timeout and send that, or crash in which case
Expand All @@ -136,6 +136,7 @@ gather_health_workers([{{Pid, _}, Mod} | Rest] = List, Acc) ->
pang -> <<"fail">>;
timeout -> <<"fail">>
end,
demonitor(Ref, [flush]),
gather_health_workers(Rest, [ {?A2B(Mod), ResultBin} | Acc ]);
{'DOWN', _MonRef, process, Pid, normal} ->
%% ignore. should always get the message from the worker before the down
Expand All @@ -159,4 +160,3 @@ ping_timeout() ->

ping_modules() ->
envy:get(oc_chef_wm, health_ping_modules,list).