Skip to content

Commit

Permalink
Fix undef internal call in supervisor2
Browse files Browse the repository at this point in the history
Must be a leftover from the refactoring in commit 0a87aea

This should prevent the below crash that was seen with an exchange
federation link

```
{undef,
    [{supervisor2,try_again_restart,
         [<0.105395.0>,
          {upstream,
              [{encrypted,
                   <<"...">>}],
              <some mirrored supervisor data>},
          {upstream,
              [{encrypted,
                   <<"...">>}],
              <some mirrored supervisor data>}],
         []}]}
```
  • Loading branch information
gomoripeti committed Jan 10, 2024
1 parent c01737d commit b6f782f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions deps/rabbit_common/src/supervisor2.erl
Original file line number Diff line number Diff line change
Expand Up @@ -878,17 +878,13 @@ do_restart_delay(Reason,

maybe_restart(Strategy, Child, State) ->
case restart(Strategy, Child, State) of
{{try_again, Reason}, NState2} ->
{{try_again, TryAgainId}, NState2} ->
%% Leaving control back to gen_server before
%% trying again. This way other incoming requests
%% for the supervisor can be handled - e.g. a
%% shutdown request for the supervisor or the
%% child.
Id = if ?is_simple(State) -> Child#child.pid;
true -> Child#child.id
end,
Args = [self(), Id, Reason],
{ok, _TRef} = timer:apply_after(0, ?MODULE, try_again_restart, Args),
try_again_restart(TryAgainId),
{ok, NState2};
Other ->
Other
Expand Down

0 comments on commit b6f782f

Please sign in to comment.