summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2013-06-15 19:47:50 +0100
committerRobert Newson <rnewson@apache.org>2013-06-15 19:47:50 +0100
commit0bb6787cec9c986feb1f6c16a280f2c0506dec0d (patch)
tree93f229610d35dd6f01483a263c84b251af9d12f9
parenta27adbf2723eae4dc0f16c8d2fd64ce1ddd28dde (diff)
downloadcouchdb-0bb6787cec9c986feb1f6c16a280f2c0506dec0d.tar.gz
Fix badrecord error in EXIT handling
The second item in the by_pid tuple is the name not a #db{} record.
-rw-r--r--src/couchdb/couch_server.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl
index 8189761c6..4aceb55bd 100644
--- a/src/couchdb/couch_server.erl
+++ b/src/couchdb/couch_server.erl
@@ -428,8 +428,7 @@ handle_info({'EXIT', _Pid, config_change}, Server) ->
{noreply, shutdown, Server};
handle_info({'EXIT', Pid, Reason}, Server) ->
Server2 = case ets:lookup(couch_dbs_by_pid, Pid) of
- [{Pid, Db}] ->
- DbName = Db#db.name,
+ [{Pid, DbName}] ->
% If the Pid is known, the name should be as well.
% If not, that's an error, which is why there is no [] clause.
@@ -440,7 +439,7 @@ handle_info({'EXIT', Pid, Reason}, Server) ->
io_lib:format(
"To open the database `~s`, Apache CouchDB "
"must be built with Erlang OTP R13B04 or higher.",
- [Db]
+ [DbName]
);
true ->
io_lib:format("Error opening database ~p: ~p", [DbName, Reason])
@@ -462,7 +461,7 @@ handle_info({'EXIT', Pid, Reason}, Server) ->
true = ets:delete(couch_dbs_by_name, DbName),
case ets:lookup(couch_sys_dbs, DbName) of
- [{Db, _}] ->
+ [{DbName, _}] ->
true = ets:delete(couch_sys_dbs, DbName),
Server;
[] ->