BryanCutler opened a new pull request, #38110:
URL: https://github.com/apache/arrow/pull/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()`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]