Skip to content

ARROW-9587: [FlightRPC][Java] clean up FlightStream/DoPut#8010

Closed
lidavidm wants to merge 3 commits intoapache:masterfrom
lidavidm:arrow-9587
Closed

ARROW-9587: [FlightRPC][Java] clean up FlightStream/DoPut#8010
lidavidm wants to merge 3 commits intoapache:masterfrom
lidavidm:arrow-9587

Conversation

@lidavidm
Copy link
Copy Markdown
Member

@lidavidm lidavidm commented Aug 19, 2020

  • Fix a bug where writes would hang forever for DoExchange
  • Make FlightRuntimeException#toString easier to read
  • Have DoPut reliably clean up the FlightStream when the call ends (instead of potentially closing it after gRPC thinks the call ends - this will be important for ARROW-9586)

@github-actions
Copy link
Copy Markdown

@lidavidm lidavidm marked this pull request as draft August 31, 2020 12:45
@lidavidm
Copy link
Copy Markdown
Member Author

Some more fixes are needed here...

@lidavidm lidavidm marked this pull request as ready for review August 31, 2020 22:21
@lidavidm
Copy link
Copy Markdown
Member Author

lidavidm commented Sep 2, 2020

@rymurr any thoughts here? This is my attempt at trying to stomp out various memory leak/usage issues in Flight, and a precursor to a way to measure per-RPC Arrow allocations, which is useful in deployments of Flight (e.g. to pinpoint problematic queries & identify if we've accidentally leaked allocations).

Copy link
Copy Markdown
Contributor

@rymurr rymurr left a comment

Choose a reason for hiding this comment

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

LGTM. Minor clarification required re the change to flight service. Really excited to see this patch! Let me know if I can help anywhere in the leak bug hunt.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

was this a permanent change or accidentally left in?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch, this was leftover from debugging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe its just the wording of the comments but this seems like its theoretically possible for an observer to put a message between 187 and the lock gets aquired in 195. Is that true? The chance is prob pretty small and not easy to code for. Just wanted a bit of clarification

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes - it's possible because the observer is run in a separate thread (by gRPC) than the application, so the observer can trigger when the application is in the middle of close(). On the client side, draining the stream (as done here) prevents this case, but on the server side, we can't rely on this, unfortunately, hence the lock to protect things.

@emkornfield
Copy link
Copy Markdown
Contributor

@lidavidm do you want another review or are you comfortable merging this?

@lidavidm
Copy link
Copy Markdown
Member Author

@emkornfield I've rebased this and it should be good once tests pass.

@lidavidm lidavidm closed this in a0175d2 Sep 15, 2020
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
- Fix a bug where writes would hang forever for DoExchange
- Make FlightRuntimeException#toString easier to read
- Have DoPut reliably clean up the FlightStream when the call ends (instead of potentially closing it after gRPC thinks the call ends - this will be important for [ARROW-9586](https://issues.apache.org/jira/browse/ARROW-9586))

Closes apache#8010 from lidavidm/arrow-9587

Authored-by: David Li <[email protected]>
Signed-off-by: David Li <[email protected]>
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