You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/08/28 13:59:37 UTC
[14/50] chttpd commit: updated refs/heads/master to 58020ab
Handle undefined result from process_info
BugzID: 21827
Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/e6d115a8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/e6d115a8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/e6d115a8
Branch: refs/heads/master
Commit: e6d115a854f399620a00823186656ea56aa44afe
Parents: 6c1f455
Author: Robert Newson <ro...@cloudant.com>
Authored: Thu Aug 15 15:21:05 2013 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Tue Jul 29 18:03:39 2014 +0100
----------------------------------------------------------------------
src/chttpd_misc.erl | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/e6d115a8/src/chttpd_misc.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_misc.erl b/src/chttpd_misc.erl
index 62cd903..12b18f8 100644
--- a/src/chttpd_misc.erl
+++ b/src/chttpd_misc.erl
@@ -293,16 +293,20 @@ couch_file_stats() ->
Candidates = [Pid || {process, Pid} <- M],
Mailboxes = lists:foldl(
fun(Pid, Acc) ->
- PI = process_info(Pid, [message_queue_len, dictionary]),
- Dictionary = proplists:get_value(dictionary, PI, []),
- case proplists:get_value('$initial_call', Dictionary) of
- {couch_file, init, 1} ->
- case proplists:get_value(message_queue_len, PI) of
- undefined -> Acc;
- Len -> [Len|Acc]
- end;
- _ ->
- Acc
+ case process_info(Pid, [message_queue_len, dictionary]) of
+ undefined ->
+ Acc;
+ PI ->
+ Dictionary = proplists:get_value(dictionary, PI, []),
+ case proplists:get_value('$initial_call', Dictionary) of
+ {couch_file, init, 1} ->
+ case proplists:get_value(message_queue_len, PI) of
+ undefined -> Acc;
+ Len -> [Len|Acc]
+ end;
+ _ ->
+ Acc
+ end
end
end, [], Candidates
),