-
Notifications
You must be signed in to change notification settings - Fork 654
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
Ensure the buffer is not released twice #3448
Conversation
When NettyOutbound#sendObject(java.lang.Object) is used, it is Netty's responsibility to release the buffer on success/error Fixes #3406
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left just a small commenting request but otherwise it looks that this addresses the issue.
OutboundThen(NettyOutbound source, Publisher<Void> thenPublisher) { | ||
this(source, thenPublisher, EMPTY_CLEANUP); | ||
} | ||
|
||
// This construction is used only with ChannelOperations#sendObject | ||
// The implementation relies on Netty's promise that Channel#writeAndFlush will release the buffer on success/error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be worth to add another line comment that the release here happens only in case when we are sure that the processing doesn't delegate to Netty because of some failure before the exchange can be continued in the thenPublisher
- which in a regular case takes ownership of the buffer.
@chemicL Thanks for the review! |
When
NettyOutbound#sendObject(java.lang.Object)
is used, it is Netty's responsibility to release the buffer on success/errorFixes #3406