nickva commented on code in PR #4491:
URL: https://github.com/apache/couchdb/pull/4491#discussion_r1144988422


##########
src/couch_index/src/couch_index_server.erl:
##########
@@ -154,7 +155,8 @@ terminate(_Reason, State) ->
 handle_call({get_index, {_Mod, _IdxState, DbName, Sig} = Args}, From, State) ->
     case ets:lookup(State#st.by_sig, {DbName, Sig}) of
         [] ->
-            spawn_link(fun() -> new_index(Args) end),
+            Pid = spawn_link(fun() -> new_index(Args) end),
+            ets:insert(State#st.by_pid, {Pid, opening, {DbName, Sig}}),

Review Comment:
   If `by_pid` can contain both {dbname, sig} and opener object wonder if we'd 
have to update this part too: 
https://github.com/apache/couchdb/blob/189db657f54f5c1d3ed54fb4a11ac73718fb4691/src/couch_index/src/couch_index_server.erl#L184-L191



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to