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:
[email protected]
With regards,
Apache Git Services