DbName is definitely correct. Good find.
On Sat, Jun 15, 2013 at 11:10 PM, Jan Lehnardt <[email protected]> wrote: > I decided to dig into the spurious 075-auth-cache.t errors that we are seeing > on travis and ci.couchdb.org. The error can be reliably reproduced under > load. Bob went in and directed me to get some more diagnostics which resulted > in this patch and I can’t get this to fail where I could previously. > > +1 to get this into 1.3.x as well after review by someone who’s more familiar > with this code than I am (Paul, Randall, Adam?) > > Thanks Bob, I enjoyed the tag-teaming on this one :) > > Best > Jan > -- > > > > On Jun 15, 2013, at 20:50 , [email protected] wrote: > >> Updated Branches: >> refs/heads/master a27adbf27 -> 0bb6787ce >> >> >> Fix badrecord error in EXIT handling >> >> The second item in the by_pid tuple is the name not a #db{} record. >> >> >> Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo >> Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/0bb6787c >> Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/0bb6787c >> Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/0bb6787c >> >> Branch: refs/heads/master >> Commit: 0bb6787cec9c986feb1f6c16a280f2c0506dec0d >> Parents: a27adbf >> Author: Robert Newson <[email protected]> >> Authored: Sat Jun 15 19:47:50 2013 +0100 >> Committer: Robert Newson <[email protected]> >> Committed: Sat Jun 15 19:47:50 2013 +0100 >> >> ---------------------------------------------------------------------- >> src/couchdb/couch_server.erl | 7 +++---- >> 1 file changed, 3 insertions(+), 4 deletions(-) >> ---------------------------------------------------------------------- >> >> >> http://git-wip-us.apache.org/repos/asf/couchdb/blob/0bb6787c/src/couchdb/couch_server.erl >> ---------------------------------------------------------------------- >> diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl >> index 8189761..4aceb55 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; >> [] -> >> >
