-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-5063: [FlightRPC][Java] Test that Flight client connections are independent #4648
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
Conversation
BryanCutler
left a comment
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.
Thanks for checking this out @lihalite ! The issue I was seeing was probably due to some grpc internals and I'm not sure of a better test to reproduce. Regardless, the fix here looks good and I think it makes things more consistent. I just had 2 minor comments.
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.
could you rename incomingAllocator -> allocator to be consistent with the the other classes?
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.
How about renaming this file to something a little more general, like "TestFlightClient.java"?
|
Thanks for taking a look, I made those two changes. You may also tangentially appreciate #4652 for improved error handling in Flight/Java. |
Codecov Report
@@ Coverage Diff @@
## master #4648 +/- ##
=========================================
Coverage ? 89.41%
=========================================
Files ? 654
Lines ? 93352
Branches ? 0
=========================================
Hits ? 83468
Misses ? 9884
Partials ? 0Continue to review full report at Codecov.
|
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.
Ignore... Wrong pr
BryanCutler
left a comment
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.
LGTM
|
While you're here @jacques-n , any issue with this change? |
|
Jacques commented on the JIRA https://issues.apache.org/jira/browse/ARROW-5063 |
|
Comment from ARROW-5063:
That is fine @jacques-n , the problem I had was when I called for (FlightEndpoint endpoint : info.getEndpoints()) {
List<Location> locations = endpoint.getLocations();
for (Location location : locations) {
FlightClient readClient = FlightClient.builder(allocator, location).build();
...
// readClient.close()Because of the error, I couldn't close the client and to check for leaks. That's why I thought it made more sense to not couple closing the allocator with closing the channel. |
|
There should be no state sharing of independent channels from distinct
clients. If so, it sounds like we have another bug and this is working
around it instead of fixing it. To confirm, the client caused another
channel closure or closing the client triggered the server to close all
channels?
…On Fri, Jun 21, 2019, 1:50 PM Bryan Cutler ***@***.***> wrote:
Comment from ARROW-5063:
I think we're trying to solve this wrong way. The idea that a client has
its own allocator that is closed as it closes out to make sure it doesn't
leak any memory is a good thing.
That is fine @jacques-n <https://github.com/jacques-n> , the problem I
had was when I called FlightClient.close() it also calls
channel.shutdown() which seemed to break the grpc channel for other
clients that were connected and caused a crash. I guess I'll have to try
out my code again to see if it is still an issue, but I basically followed
IntegrationTestClient that loops over locations and make a client for each
for (FlightEndpoint endpoint : info.getEndpoints()) {
List<Location> locations = endpoint.getLocations();
for (Location location : locations) {
FlightClient readClient = FlightClient.builder(allocator, location).build();
...
// readClient.close()
Because of the error, I couldn't close the client and to check for leaks.
That's why I thought it made more sense to not couple closing the allocator
with closing the channel.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4648?email_source=notifications&email_token=AABMYNVG56BW6G4DCSPB7NTP3U5JLA5CNFSM4H2RNMOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYJRWKQ#issuecomment-504568618>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABMYNWLSDGU4QORJ7PN4X3P3U5JLANCNFSM4H2RNMOA>
.
|
|
It sounds like Bryan found that closing one client channel would close other client channels. This adds a simple unit test for that scenario, but we should do more investigation (probably the unit test can be made more robust to ensure that multiple clients are active at once). AFAIK, some gRPC implementations do share channels internally; I believe C++ is one of them, but it also doesn't require you to close a channel explicitly. |
|
Changed:
|
From what I remember, multiple clients had the same location and seemed to share a channel. So closing one client, then trying to read from the next failed. I tried to debug what was going on with grpc internally but it was a bit confusing.. I'll try to reproduce the issue again and I'll open another JIRA if it still happens. |
BryanCutler
left a comment
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.
The test looks fine and I think we can merge it. @lihalite can you change the PR title/description to match the changes?
|
@BryanCutler sure, updated. |
|
Looks like this is failing due to checkstyle |
|
This is now failing due to JPype, I can rebase once that's fixed. |
|
I just posted a (temporary) fix for the jpype issue, will merge that once I have a passing build |
|
Rebased, personal Travis: https://travis-ci.com/lihalite/arrow/builds/116983004 |
wesm
left a comment
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.
+1
|
@lihalite I think this PR has a conflict with the application metadata patch |
|
It looks like a quick fix, I'll post a PR |
|
I think I fixed this already. PR pending review
…On Wednesday, June 26, 2019, Bryan Cutler ***@***.***> wrote:
It looks like a quick fix, I'll post a PR
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4648?email_source=notifications&email_token=AEIKYDQKWKUQ7AA7HPSKFRTP4QQMJA5CNFSM4H2RNMOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYVPCTQ#issuecomment-506130766>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEIKYDUK24CDEQBDHLDJAD3P4QQMJANCNFSM4H2RNMOA>
.
|
|
Oops, I didn't see that. I'll close mine. |
… independent This adds a test that creates two Flight clients to the same server, then closes one Flight client while the other still has an operation in progress, in order to ensure that gRPC doesn't share connections between the clients. Author: David Li <[email protected]> Closes apache#4648 from lihalite/arrow-5063 and squashes the following commits: 7002bc3 <David Li> Add test for independent Flight client shutdown in Java
This adds a test that creates two Flight clients to the same server, then closes one Flight client while the other still has an operation in progress, in order to ensure that gRPC doesn't share connections between the clients.