Permalink
Browse files

Fixing a race condition.

During system blockage, the gen_server:call limit of 5 seconds
could go off before giving an answer, creating an incomplete
deduplication session between lager_deduper and the error
reporter. This would in turn create dead entries that would never
get dumped in the future, effectively deleting a type of error
messages from the logs.

By setting the timeout to infinity, we allow more tolerance to
overload situations (which is when the deduper is useful) and
fix the issue entirely.
  • Loading branch information...
1 parent fda26db commit 3231aae8147c7f1322799f8bf77c14d4124707c2 @ferd committed Oct 30, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/lager_deduper.erl
@@ -40,7 +40,7 @@ dedup_notify(Dest, Level, Timestamp, Msg) ->
end.
ask_seen(Dest, Level, Timestamp, Msg, Key) ->
- case gen_server:call(?SERVER, {seen, Key}) of
+ case gen_server:call(?SERVER, {seen, Key}, infinity) of
yes ->
ok;
no when Dest =:= [] ->

0 comments on commit 3231aae

Please sign in to comment.