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

Fix undef internal call in supervisor2 #10305

Merged
merged 1 commit into from Jan 10, 2024
Merged

Conversation

gomoripeti
Copy link
Contributor

Proposed Changes

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>}],
         []}]}

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

Checklist

Put an x in the boxes that apply.
You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally with my changes
  • If relevant, I have added necessary documentation to https://github.com/rabbitmq/rabbitmq-website
  • If relevant, I have added this change to the first version(s) in release-notes that I expect to introduce it

Further Comments

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>}],
         []}]}
```
true -> Child#child.id
end,
Args = [self(), Id, Reason],
{ok, _TRef} = timer:apply_after(0, ?MODULE, try_again_restart, Args),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

timer:apply_after with zero timeout executes the function immediatly but in a spawned process. However try_again_restart/1 only sends a gen_server cast so it should be fine to call it from the same process (same way as from restart/2)

@gomoripeti
Copy link
Contributor Author

(test failures look unrelated)

@lukebakken lukebakken self-assigned this Jan 10, 2024
@michaelklishin michaelklishin merged commit 22dcfa6 into rabbitmq:main Jan 10, 2024
9 of 10 checks passed
michaelklishin added a commit that referenced this pull request Jan 10, 2024
Fix undef internal call in supervisor2 (backport #10305)
@gomoripeti gomoripeti deleted the sup2 branch February 12, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants