davisp commented on a change in pull request #1182: fixed race is_idle
URL: https://github.com/apache/couchdb/pull/1182#discussion_r170678862
##########
File path: src/couch/src/couch_db.erl
##########
@@ -200,7 +200,12 @@ reopen(#db{main_pid = Pid, fd = Fd, fd_monitor = OldRef,
user_ctx = UserCtx}) ->
incref(#db{fd = Fd} = Db) ->
Ref = erlang:monitor(process, Fd),
- {ok, Db#db{fd_monitor = Ref}}.
+ receive
+ {'DOWN', Ref, _, _, _} ->
Review comment:
Thinking more on this, I'd use the atom down instead of retry. Was thinking
in terms of the couch_server's response, but that's not appropriate when
considering incref more abstractly. So something like `-spec incref(Db::db())
-> {ok, NewDb::db()} | down.`
----------------------------------------------------------------
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