forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-38096: [Java] FlightStream with metadata can cause error whe…
…n closing (apache#38110) ### Rationale for this change The Java FlightStream can raise an error if metadata is transferred and ends up being closed twice. ``` java.lang.IllegalStateException: RefCnt has gone negative at org.apache.arrow.util.Preconditions.checkState(Preconditions.java:458) at org.apache.arrow.memory.BufferLedger.release(BufferLedger.java:130) at org.apache.arrow.memory.BufferLedger.release(BufferLedger.java:104) at org.apache.arrow.memory.ArrowBuf.close(ArrowBuf.java:1044) at org.apache.arrow.util.AutoCloseables.close(AutoCloseables.java:97) at org.apache.arrow.flight.FlightStream.close(FlightStream.java:208) ``` ### What changes are included in this PR? When FlightStream is closed, remove any reference of previous metadata to prevent reference count going negative if closed again. Also added `ExchangeReaderWriter.getResult()` for convenience and clear up ambiguity on error handling. ### Are these changes tested? Unit tests added for closing with metadata and ### Are there any user-facing changes? Added `ExchangeReaderWriter.getResult()` * Closes: apache#38096 Authored-by: Bryan Cutler <[email protected]> Signed-off-by: David Li <[email protected]>
- Loading branch information
1 parent
a45dd10
commit 9afb870
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters