Skip to content

Commit

Permalink
don't crash nouveau_index_updater for any DOWN Reason
Browse files Browse the repository at this point in the history
Hard to induce in a unit test but under stress it is possible to get back
Reason's like `{timeout, {gen_server, call, ...` among others. Pass these
along to the client processes and do not crash the manager.
  • Loading branch information
rnewson committed Jun 18, 2024
1 parent 3dee4e7 commit 03f2f1f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/nouveau/src/nouveau_index_manager.erl
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,22 @@ handle_info({'DOWN', IndexerRef, process, _Pid, Reason}, State) ->
true = ets:delete(?BY_REF, IndexerRef),
[{_, Index, Queue0}] = ets:lookup(?BY_DBSIG, DbSig),
{{value, From}, Queue1} = queue:out(Queue0),
case Reason of
ok ->
gen_server:reply(From, ok);
{error, Msg} ->
if
Reason /= ok ->
couch_log:error(
"~p: db:~s ddoc:~s index:~s failed with: ~p",
[
?MODULE,
mem3:dbname(Index#index.dbname),
Index#index.ddoc_id,
Index#index.name,
Msg
Reason
]
),
gen_server:reply(From, {error, Msg})
);
true ->
ok
end,
gen_server:reply(From, Reason),
case queue:is_empty(Queue1) of
true ->
true = ets:delete(?BY_DBSIG, DbSig);
Expand Down

0 comments on commit 03f2f1f

Please sign in to comment.