iilyak commented on a change in pull request #474: 3364 fix view compactor 
unknown info
URL: https://github.com/apache/couchdb/pull/474#discussion_r111420397
 
 

 ##########
 File path: src/couch_index/src/couch_index_compactor.erl
 ##########
 @@ -81,6 +85,14 @@ handle_cast(_Mesg, State) ->
 
 handle_info({'EXIT', Pid, normal}, #st{pid=Pid}=State) ->
     {noreply, State#st{pid=undefined}};
+handle_info({'EXIT', Pid, Reason}, #st{pid = Pid} = State) ->
+    #st{idx = Idx, mod = Mod} = State,
+    {ok, IdxState} = gen_server:call(Idx, {compaction_failed, Reason}),
 
 Review comment:
   > First, there are nothing inherently wrong with using gen_server's call. 
   
   I disagree, for few reasons:
   1. I do believe that message format changes more often
   2. I can use a stable expression for grep (such as `<module>:<function>`) to 
find all places which need to be updated in the case we need to update in case 
we have to.
   3. If we have an API function in the module which implements `gen_server` 
behavior we can use guards to do basic argument validation. This is helpful 
because most of the time we want to crash the caller and not the gen_server 
process.
   
   Anyway I am fine with merging it as is. Since couchdb code base uses 
`gen_server:call` everywhere. 
 
----------------------------------------------------------------
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

Reply via email to