Skip to content

Throw an exception instead of trying to transmit a header frame that exceeds max frame size #363

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
merged 1 commit into from
Apr 30, 2018

Conversation

ibolotin
Copy link

Proposed Changes

Addresses issue #362
Instead of trying to transmit header frame that exceeds max frame size (that results in server shutdown of connection with frame_too_large error and breaks all open channels) - throw IllegalArgumentException stating that "Content headers exceeded max frame size"

Types of Changes

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

throw new IllegalArgumentException("Content headers exceeded max frame size: " +
headerFrame.size() + " > " + frameMax);
}
connection.writeFrame(m.toFrame(channelNumber));
Copy link
Author

Choose a reason for hiding this comment

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

moved this code down to after size check to avoid leaving channel in invalid state in case exception was thrown

@ibolotin ibolotin force-pushed the headers-frame-too-large branch from cb8d7e4 to 4b8ab88 Compare April 28, 2018 06:28
Copy link
Contributor

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

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

This looks reasonable. I'll wait for @acogoluegnes' review before merging.

@acogoluegnes acogoluegnes added this to the 5.3.0 milestone Apr 30, 2018
@acogoluegnes acogoluegnes merged commit 8be7848 into rabbitmq:master Apr 30, 2018
@acogoluegnes
Copy link
Contributor

@ibolotin 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