couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [7/9] couch commit: updated refs/heads/windsor-merge to 2c36e16
Date Thu, 07 Aug 2014 17:57:24 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/a7d4b8f3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/a7d4b8f3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/a7d4b8f3

Branch: refs/heads/windsor-merge
Commit: a7d4b8f352318273f14af79050321bfb22829bcf
Parents: 6a584b5
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Fri Feb 28 12:45:02 2014 -0500
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Aug 7 18:55:10 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/a7d4b8f3/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