couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [05/14] couch-stats commit: updated refs/heads/master to bb24add
Date Wed, 20 Aug 2014 13:09:13 GMT
Log unknown messages instead of crashing


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-stats/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-stats/commit/6efb035b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-stats/tree/6efb035b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-stats/diff/6efb035b

Branch: refs/heads/master
Commit: 6efb035b7f181e3024b3cd87a1875c78f0bf2274
Parents: ba150cd
Author: Benjamin Anderson <b@banjiewen.net>
Authored: Wed Feb 12 09:16:09 2014 -0800
Committer: Robert Newson <rnewson@apache.org>
Committed: Tue Aug 19 14:48:31 2014 +0100

----------------------------------------------------------------------
 src/couch_stats_process_tracker.erl | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-stats/blob/6efb035b/src/couch_stats_process_tracker.erl
----------------------------------------------------------------------
diff --git a/src/couch_stats_process_tracker.erl b/src/couch_stats_process_tracker.erl
index bead7c1..825142b 100644
--- a/src/couch_stats_process_tracker.erl
+++ b/src/couch_stats_process_tracker.erl
@@ -35,21 +35,24 @@ init([]) ->
     {ok, #st{tracked = dict:new()}}.
 
 handle_call(Msg, _From, State) ->
-    {stop, {unknown_call, Msg}, error, State}.
+    twig:log(notice, "~p received unknown call ~p", [?MODULE, Msg]),
+    {noreply, State}.
 
 handle_cast({track, Pid, Name}, #st{tracked=Tracked}=State) ->
     couch_stats:increment_counter(Name),
     Ref = erlang:monitor(process, Pid),
     {noreply, State#st{tracked=dict:store(Ref, Name, Tracked)}};
 handle_cast(Msg, State) ->
-    {stop, {unknown_cast, Msg}, State}.
+    twig:log(notice, "~p received unknown cast ~p", [?MODULE, Msg]),
+    {noreply, State}.
 
 handle_info({'DOWN', Ref, _, _, _}, #st{tracked=Tracked}=State) ->
     Name = dict:fetch(Ref, Tracked),
     couch_stats:decrement_counter(Name),
     {noreply, State#st{tracked=dict:erase(Ref, Tracked)}};
 handle_info(Msg, State) ->
-    {stop, {unknown_info, Msg}, State}.
+    twig:log(notice, "~p received unknown message ~p", [?MODULE, Msg]),
+    {noreply, State}.
 
 terminate(_Reason, _State) ->
     ok.


Mime
View raw message