Forgot to mention, this issue was actually not happening in any Apache CouchDB release. Apologies for the confusion. I'll update the comment.
On Wed, Aug 10, 2011 at 2:49 PM, <[email protected]> wrote: > Author: fdmanana > Date: Wed Aug 10 21:49:20 2011 > New Revision: 1156381 > > URL: http://svn.apache.org/viewvc?rev=1156381&view=rev > Log: > Revert couch_server changes added in revision 1156360 > > Leaving the tests however since it doesn't hurt. > > Modified: > couchdb/trunk/src/couchdb/couch_server.erl > > Modified: couchdb/trunk/src/couchdb/couch_server.erl > URL: > http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_server.erl?rev=1156381&r1=1156380&r2=1156381&view=diff > ============================================================================== > --- couchdb/trunk/src/couchdb/couch_server.erl (original) > +++ couchdb/trunk/src/couchdb/couch_server.erl Wed Aug 10 21:49:20 2011 > @@ -316,13 +316,11 @@ handle_call({open, DbName, Options}, {Fr > {reply, couch_db:open_ref_counted(MainPid, FromPid), Server} > end; > handle_call({create, DbName, Options}, From, Server) -> > - FileName = get_full_filename(Server, ?b2l(DbName)), > - case file:open(FileName, [read]) of > - {ok, Fd} -> > - ok = file:close(Fd), > - {reply, file_exists, Server}; > - Error -> > - open_db(DbName, Server, [create | Options], From) > + case ets:lookup(couch_dbs_by_name, DbName) of > + [] -> > + open_db(DbName, Server, [create | Options], From); > + [_AlreadyRunningDb] -> > + {reply, file_exists, Server} > end; > handle_call({delete, DbName, _Options}, _From, Server) -> > DbNameList = binary_to_list(DbName), > > > -- Filipe David Manana, [email protected], [email protected] "Reasonable men adapt themselves to the world. Unreasonable men adapt the world to themselves. That's why all progress depends on unreasonable men."
