From 4cf77d070c368dc871cb257d2358acbf60ba9381 Mon Sep 17 00:00:00 2001 From: Garret Smith Date: Wed, 18 Nov 2015 14:40:54 -0800 Subject: [PATCH] Quick and dirty fix for https://github.com/boundary/folsom/issues/30 A history will survive a process crash without incident since it is owned by folsom_sup. This will leave the rest of the folsom ets tables in a consistent state (all are owned by folsom_sup). --- src/folsom_metrics_history.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/folsom_metrics_history.erl b/src/folsom_metrics_history.erl index 6913063..6f769c6 100644 --- a/src/folsom_metrics_history.erl +++ b/src/folsom_metrics_history.erl @@ -42,6 +42,7 @@ new(Name) -> Tid = ets:new(history, ?ETSOPTS), ets:insert(?HISTORY_TABLE, {Name, #history{tid=Tid}}), + ets:give_away(Tid, whereis(folsom_sup), none), ok. update(Name, Size, Value) ->