You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/02/26 17:52:03 UTC

[GitHub] davisp commented on a change in pull request #1182: fixed race is_idle

davisp commented on a change in pull request #1182: fixed race is_idle
URL: https://github.com/apache/couchdb/pull/1182#discussion_r170677921
 
 

 ##########
 File path: src/couch/src/couch_server.erl
 ##########
 @@ -77,16 +77,20 @@ open(DbName, Options0) ->
     case ets:lookup(couch_dbs, DbName) of
     [#entry{db = Db0, lock = Lock} = Entry] when Lock =/= locked ->
         update_lru(DbName, Entry#entry.db_options),
-        {ok, Db1} = couch_db:incref(Db0),
-        couch_db:set_user_ctx(Db1, Ctx);
+        case couch_db:incref(Db0) of
+            {down,Db0} -> open(DbName, Options0);
 
 Review comment:
   You should add a Retry argument to this function so that we limit ourself to a defined number of attempts or else this could lead to infinite looping (granted that's unlikely but its a possibility if we don't prevent it).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services