Skip to content

feat(Channel): Remove checked exception from interface Channel.abort(...) as it should silently discard any exceptions #1039

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

Merged

Conversation

enniokerber
Copy link

Proposed Changes

As proposed in #434, I eliminated the "throws" clause from the Channel.abort(...) interface in order to align with the desired behaviour, which is also document above the method definitions:
Any encountered exceptions in the close operation are silently discarded.

At the current time, consumers calling the abort(...) method will have to manually check for IOException by using a try-catch-block, which is obsolete and just unnecessarily blows up code.

Types of Changes

  • Bugfix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (correction or otherwise)
  • Cosmetics (whitespace, appearance)

As already mentioned inside #434:
This is a breaking change though (code catching the IOException won't compile anymore), so it must go into 6.0.

Checklist

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

Further Comments

It seems as there are no existing tests for class AutorecoveringChannel. This might be something that could be improved in the future. I just added some initial tests for the abort methods.

…...) as it should silently discard any exceptions
@michaelklishin
Copy link
Contributor

Autorecovering channels are tested, just like connections, in connection recovery integration tests.

@acogoluegnes acogoluegnes merged commit 3d3d128 into rabbitmq:main May 22, 2023
@acogoluegnes
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants