iilyak commented on a change in pull request #3766:
URL: https://github.com/apache/couchdb/pull/3766#discussion_r796014407
##########
File path: src/smoosh/src/smoosh_channel.erl
##########
@@ -194,21 +235,164 @@ handle_info(check_window, State0) ->
end,
erlang:send_after(60 * 1000, self(), check_window),
{noreply, FinalState};
+handle_info(start_recovery, #state{name = Name, waiting = Waiting0} = State0)
->
+ RecActive = recover(active_file_name(Name)),
+ Waiting1 = lists:foldl(
+ fun(DbName, Acc) ->
+ case couch_db:is_compacting(DbName) of
+ true ->
+ Priority = smoosh_server:get_priority(Name, DbName),
+ smoosh_priority_queue:in(DbName, Priority, Priority, Acc);
+ false ->
+ Acc
+ end
+ end,
+ Waiting0,
+ RecActive
+ ),
+ _ = State0#state{waiting = Waiting1},
+ ok = wait_for_active_restart(State0),
Review comment:
We shouldn't block in gen_server callbacks. If we block here we would be
waiting forever (until timeot). Since we never reach the call
erlang:send_after(?ACTIVATE_DELAY_IN_MSEC. Even if we move send after we would
still be blocked.
--
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]