Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #211 from heroku/control-rod-drain-forwarding
Browse files Browse the repository at this point in the history
control rod to stop drain forwarding
  • Loading branch information
apg authored Jan 12, 2018
2 parents 1aa63e4 + 620e618 commit ee72a91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/logplex_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ cache_os_envvars() ->
,{disable_redgrid, ["DISABLE_REDGRID"],
optional,
atom}
,{disable_drain_forwarding, ["DISABLE_DRAIN_FORWARDING"],
optional,
atom}
]),
ok.

Expand Down
6 changes: 4 additions & 2 deletions src/logplex_message.erl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ process_msg(RawMsg, ChannelId, Token, TokenName, ShardInfo)
Flag ->
CookedMsg = iolist_to_binary(re:replace(RawMsg, Token, TokenName)),
logplex_firehose:post_msg(ChannelId, TokenName, RawMsg),
process_drains(ChannelId, CookedMsg),
process_drains(ChannelId, CookedMsg, logplex_app:config(deny_drain_forwarding, false)),
process_tails(ChannelId, CookedMsg),
process_redis(ChannelId, ShardInfo, CookedMsg, logplex_app:config(deny_redis_buffers, Flag))
end.
Expand Down Expand Up @@ -118,7 +118,9 @@ do_process_error({false, _HerokuOrigin}, _ChannelID, _Origin, Fmt, Args) ->
[channel_id, ErrMsg]),
ignored.

process_drains(ChannelID, Msg) ->
process_drains(ChannelID, Msg, true) ->
ok;
process_drains(ChannelID, Msg, false) ->
logplex_channel:post_msg({channel, ChannelID}, Msg).

process_tails(ChannelId, Msg) ->
Expand Down

0 comments on commit ee72a91

Please sign in to comment.