[ 
https://issues.apache.org/jira/browse/COUCHDB-2049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13892153#comment-13892153
 ] 

Paul Joseph Davis commented on COUCHDB-2049:
--------------------------------------------

We should add protection in couch_index/src/couch_index.erl for the case that 
couch_util:with_db/2 throw the not_found error. couch_index should log that its 
database has disappeared and then terminate normally. couch_index dies when an 
index dies abnormally on purpose and should continue doing so.

Ignoring abnormal exits (or at least, not iterating specifically which abnormal 
exits you want to ignore) is a very easy way to get the managing process into 
an infinite loop attempting to start a child process that dies during 
initialization.

> latency in creation wit a quick deletion crash couch_index_server
> -----------------------------------------------------------------
>
>                 Key: COUCHDB-2049
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2049
>             Project: CouchDB
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Database Core
>            Reporter: Benoit Chesneau
>
> When you quickly start to refresh an index:
> {code}
> refresh(#db{name=DbName}, DDoc) ->
>     refresh(DbName, DDoc);
> refresh(Db, DDoc) ->
>     UpdateSeq = couch_util:with_db(Db, fun(WDb) ->
>                     couch_db:get_update_seq(WDb)
>             end),
>     case couch_index_server:get_index(couch_mrview_index, Db, DDoc) of
>         {ok, Pid} ->
>             case catch couch_index:get_state(Pid, UpdateSeq) of
>                 {ok, _} -> ok;
>                 Error -> {error, Error}
>             end;
>         Error ->
>             {error, Error}
>     end.
> {code}
> and immediately delete the database it trigger the following error:
> {code}
> [error] [<0.184.0>] Could not open file 
> /Users/benoitc/refuge/couchdb/test/etap/../../test/out/data/foo.couch: no 
> such file or directory
> [info] [<0.167.0>] Closing index for db: foo idx: _design/bar sig: 
> "6551000fd7a75dab3f60065ce1308dbe"
> reason: {bad_return_value,{not_found,no_db_file}}
> [error] [<0.167.0>] ** Generic server <0.167.0> terminating 
> ** Last message in was commit
> ** When Server state == {st,couch_mrview_index,
> {code}
> which is received by the couch_index_server and crash it.. Shouldn't the 
> crash in couch_index be ignored at that point? 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to