Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function clause in hastings_index:handle_info/2 #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jiangphcn
Copy link
Contributor

Overview

Add new clause to catch the shutdown of hastings_index_manager

2018-12-18T00:01:35.819657Z db10.ibm004 <0.18787.5253> - gen_server <0.18787.5253> terminated with reason: no function clause matching hastings_index:handle_info({'EXIT',<0.13377.0>,shutdown}, {st,<0.13377.0>,{h_idx,{rtree,<0.13343.5358>},<<"shards/a0000000-bfffffff/paulccastro/weatherpolyg...">>,...},...})(line:296) at gen_server:try_dispatch/4(line:616) <= gen_server:handle_msg/6(line:686) <= proc_lib:init_p_do_apply/3(line:247)#012 last msg: {'EXIT',<0.13377.0>,shutdown}#012 state: {st,<0.13377.0>,{h_idx,{rtree,<0.13343.5358>},<<"shards/a0000000-bfffffff/paulccastro/weatherpolygons.1457733603">>,<<"_design/geodd">>,<<"geoidx">>,<<"function(doc) {if (doc.geometry && doc.geometry.coordinates) {st_index(doc.geometry);}}">>,<<"javascript">>,<<"rtree">>,2,4326,0,<<"e66df316792ab411705e2741bba44371">>},<0.6709.6434>,undefined,[],0}#012 

Related Issues or Pull Requests

https://cloudant.fogbugz.com/f/cases/114352

   - add new clause to catch the shutdown of hastings_index_manager

Bugzid: 114352
@@ -339,6 +339,10 @@ handle_info({'EXIT', Pid, Reason}, #st{index=#h_idx{pid={_, Pid}}} = St) ->
couch_log:info(Fmt, [index_name(St#st.index), Reason]),
[gen_server:reply(P, {error, Reason}) || {P, _} <- St#st.waiting_list],
{stop, normal, St};
handle_info({'EXIT', Pid, Reason}, St) ->
% probably hastings_index_manager.
couch_log:notice("Unknown pid ~p closed with reason ~p", [Pid, Reason]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that in all other cases where we handle EXIT we do gen_server:reply. Why not in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the same approach in dreyfus https://github.com/cloudant-labs/dreyfus/blob/master/src/dreyfus_index.erl#L228-L231. My understanding is that it is not necessary to do gen_server:reply to pid in waiting_list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants