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

ARROW-10441: [Java] Prevent closure of shared channels for FlightClient #8581

Closed
wants to merge 2 commits into from

Conversation

kylepbit
Copy link

@kylepbit kylepbit commented Nov 3, 2020

Add a proxy for ManagedChannel to prevent closure of shared
channels when specified for FlightClient in FlightGrpcUtils.

channels when specified for FlightClient.
@kylepbit kylepbit changed the title [Java] Prevent closure of shared channels for FlightClient ARROW-10441: [Java] Prevent closure of shared channels for FlightClient Nov 3, 2020
@github-actions
Copy link

github-actions bot commented Nov 3, 2020

@kylepbit
Copy link
Author

kylepbit commented Nov 3, 2020

@lidavidm here's a PR for the shared channel issue: https://issues.apache.org/jira/browse/ARROW-10441

Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

Looks good - just two small comments.

@@ -49,10 +143,10 @@ public static BindableService createFlightService(BufferAllocator allocator, Fli
/**
* Creates a Flight client.
* @param incomingAllocator Memory allocator
* @param channel provides a connection to a gRPC server
* @param channel provides a connection to a gRPC server. Will not be closed on closure of the returned FlightClient.
Copy link
Member

Choose a reason for hiding this comment

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

This would be a breaking change - can we do this in a separate method?

Copy link
Author

Choose a reason for hiding this comment

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

To clarify, introduce a new method for creating flight clients which uses the proxy? To me that persists the issue that this was intended to solve, which is that closing a client closes the channel that was passed to it when that channel may be used to create multiple clients. Otherwise, I would suggest this simply be doc-fixed by noting that the client takes ownership and will close the channel upon closure.

Copy link
Member

Choose a reason for hiding this comment

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

Yes - how does that not solve the problem? The caller can choose whether the FlightClient takes ownership of the channel or not by calling different methods. But if the current method is modified, then any existing code will suddenly silently leak channels.

Update naming of proxy channel to better reflect behaviour.
@kylepbit
Copy link
Author

kylepbit commented Nov 4, 2020

@lidavidm I believe the JNI issue is not related and is a common problem - how can we get this merged?

@lidavidm lidavidm closed this in 3eb6e69 Nov 4, 2020
@lidavidm
Copy link
Member

lidavidm commented Nov 4, 2020

No problem, I was just waiting for other builds to pass. Thanks!

GeorgeAp pushed a commit to sirensolutions/arrow that referenced this pull request Jun 7, 2021
Add a proxy for ManagedChannel to prevent closure of shared
channels when specified for FlightClient in FlightGrpcUtils.

Closes apache#8581 from kylepbit/ARROW-10441

Authored-by: Kyle Porter <kporter@dremio.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
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.

None yet

3 participants