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

InternalStreamConnection must release buffers obtained via ByteBufferBsonOutput.getByteBuffers #1160

Merged
merged 4 commits into from
Jul 27, 2023

Conversation

stIncMale
Copy link
Member

@stIncMale stIncMale commented Jul 27, 2023

@stIncMale stIncMale requested a review from jyemin July 27, 2023 00:59
@stIncMale stIncMale self-assigned this Jul 27, 2023
@@ -46,7 +46,8 @@ public interface Stream extends BufferProvider{
/**
* Write each buffer in the list to the stream in order, blocking until all are completely written.
*
* @param buffers the buffers to write
* @param buffers the buffers to write. The operation must not {@linkplain ByteBuf#release() release} any buffer from {@code buffers},
* unless it also {@linkplain ByteBuf#retain() retained} it, and releasing is meant to compensate for that.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking change, right? If a third party had written something like NettyStream, it would now be broken with the change to InternalStreamConnection.

I have never heard of anyone actually writing their own Stream implementation, so it's not likely to affect anyone in practice, but it should at least make the release notes.

Copy link
Member Author

@stIncMale stIncMale Jul 27, 2023

Choose a reason for hiding this comment

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

Thanks!💡 I was thinking that I'll need to update #1154 if/when this is merged and the changes in #1154 are rebased on top of the new master, but it didn't occur to me that users may be in a similar situation.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is ok even in a minor release. Just mark the JAVA ticket as Docs Changed Needed so we get something in the release notes.

Copy link
Member Author

Choose a reason for hiding this comment

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

I documented the required doc change in the "Documentation Changes Summary" in https://jira.mongodb.org/browse/DOCSP-31709.

@stIncMale stIncMale requested a review from jyemin July 27, 2023 15:05
Copy link
Contributor

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -46,7 +46,8 @@ public interface Stream extends BufferProvider{
/**
* Write each buffer in the list to the stream in order, blocking until all are completely written.
*
* @param buffers the buffers to write
* @param buffers the buffers to write. The operation must not {@linkplain ByteBuf#release() release} any buffer from {@code buffers},
* unless it also {@linkplain ByteBuf#retain() retained} it, and releasing is meant to compensate for that.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is ok even in a minor release. Just mark the JAVA ticket as Docs Changed Needed so we get something in the release notes.

@stIncMale stIncMale merged commit 7e8d1da into mongodb:master Jul 27, 2023
58 checks passed
@stIncMale stIncMale deleted the JAVA-5084 branch July 27, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants