Skip to content

CQ: 'handle_cast(init, State) ' may cause exceptions #14151

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions deps/rabbit/src/rabbit_amqqueue_process.erl
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ init_it(Recover, From, State = #q{q = Q0}) ->
State#q{backing_queue = BQ, backing_queue_state = BQS}}}
end.

stop_for_init(none, {Operation, Reason, _Reply, State}) ->
{Operation, Reason, State};
stop_for_init(_From, Result) ->
Result.

init_it2(Recover, From, State = #q{q = Q,
backing_queue = undefined,
backing_queue_state = undefined}) ->
Expand All @@ -226,16 +231,16 @@ init_it2(Recover, From, State = #q{q = Q,
fun() -> emit_stats(State1) end),
noreply(State1);
false ->
{stop, normal, {existing, Q1}, State}
stop_for_init(From, {stop, normal, {existing, Q1}, State})
end;
{error, timeout} ->
Reason = {protocol_error, internal_error,
"Could not declare ~ts on node '~ts' because the "
"metadata store operation timed out",
[rabbit_misc:rs(amqqueue:get_name(Q)), node()]},
{stop, normal, Reason, State};
stop_for_init(From, {stop, normal, Reason, State});
Err ->
{stop, normal, Err, State}
stop_for_init(From, {stop, normal, Err, State})
end.

recovery_status(new) -> {no_barrier, new};
Expand Down
Loading