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/07 17:38:08 UTC

[46/50] couch commit: updated refs/heads/windsor-merge to 6e60cbe

Always report why couch_server crashes

On servers with a large number of open databases the couch_server state
is too large to be logged, and so when it crashes we miss the reason for
the crash.  This patch adds an extra message that redacts enough of the
server state to ensure a properly-formatted message.

BugzID: 26902


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

Branch: refs/heads/windsor-merge
Commit: 98cd3411f632944a6eae9a659dd5ae44a5cfa587
Parents: fe940e8
Author: Adam Kocoloski <ad...@cloudant.com>
Authored: Fri Feb 28 12:45:02 2014 -0500
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Aug 7 16:27:01 2014 +0100

----------------------------------------------------------------------
 src/couch_server.erl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/98cd3411/src/couch_server.erl
----------------------------------------------------------------------
diff --git a/src/couch_server.erl b/src/couch_server.erl
index 28dfc79..964ecad 100644
--- a/src/couch_server.erl
+++ b/src/couch_server.erl
@@ -210,7 +210,9 @@ init([]) ->
                 update_lru_on_read=UpdateLruOnRead,
                 start_time=couch_util:rfc1123_date()}}.
 
-terminate(_Reason, _Srv) ->
+terminate(Reason, Srv) ->
+    ?LOG_ERROR("couch_server terminating with ~p, state ~2048p", [Reason,
+         Srv#server{dbname_regexp = redacted, lru = redacted}]),
     ets:foldl(fun(#db{main_pid=Pid}, _) -> couch_util:shutdown_sync(Pid) end,
         nil, couch_dbs),
     ok.