couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [24/50] couch commit: updated refs/heads/master to 9d0ac7d
Date Thu, 28 Aug 2014 12:12:00 GMT
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/3d58af95
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/3d58af95
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/3d58af95

Branch: refs/heads/master
Commit: 3d58af95968fc888339909d8b4be44e886db9b43
Parents: 507e5ac
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Fri Feb 28 12:45:02 2014 -0500
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Aug 28 13:00: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/3d58af95/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.


Mime
View raw message