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

Remove unused rabbit_definitions:apply_defs/5 #6638

Merged
merged 1 commit into from Dec 12, 2022

Conversation

binarin
Copy link
Contributor

@binarin binarin commented Dec 12, 2022

Proposed Changes

Turns out rabbit_definitions:apply_defs/5 is not being used anywhere - it's a copy of apply_defs/4, but with custom error handling. And it contains a bug where it was trying to import bindings too early:

concurrent_for_all(bindings, ActingUser, Map, VHost, fun add_binding/3),

apply_defs/4 imports exchanges at exactly the same place.

This PR removes this unused function, and a bunch of related exports that are not being used outside of their own module.

Types of Changes

  • 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

  • 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

`rabbit_definitions:apply_defs/5` contains a bug
where it was trying to import bindings too
early (https://github.com/rabbitmq/rabbitmq-server/blob/aec3dcbf37ac9f6cecf9f4c6bde7a49c4f045857/deps/rabbit/src/rabbit_definitions.erl#L480).
`apply_defs/4` imports exchanges at exactly the same place.

Turns out `apply_defs/5` is almost an verbatim copy of
`apply_defs/4`, just with custom error handling - and it isn't being
used anywhere in the source code.

Also removes related unused exports.
@michaelklishin michaelklishin added this to the 3.11.5 milestone Dec 12, 2022
@michaelklishin michaelklishin merged commit f216ecc into main Dec 12, 2022
@michaelklishin michaelklishin deleted the unused-buggy-apply_defs_5 branch December 12, 2022 18:06
michaelklishin added a commit that referenced this pull request Dec 12, 2022
Remove unused rabbit_definitions:apply_defs/5 (backport #6638)
michaelklishin added a commit that referenced this pull request Dec 12, 2022
Remove unused rabbit_definitions:apply_defs/5 (backport #6638) (backport #6643)
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

2 participants