Skip to content

MINOR: Empty stream double check - #742

Merged
lidavidm merged 1 commit into
apache:mainfrom
adampolomski:gzipstreamfix
May 15, 2025
Merged

MINOR: Empty stream double check#742
lidavidm merged 1 commit into
apache:mainfrom
adampolomski:gzipstreamfix

Conversation

@adampolomski

@adampolomskiadampolomski commented May 9, 2025

Copy link
Copy Markdown
Contributor

What's Changed

In some cases
InflaterInputStream can return a non zero on available() method call, while it is actually at EOS. A subsequent read() call would respond with -1 and eventually cause:

Caused by: org.apache.arrow.flight.FlightRuntimeException: Failed to read message.
at org.apache.arrow.flight.CallStatus.toRuntimeException(CallStatus.java:121)
at org.apache.arrow.flight.grpc.StatusUtils.fromGrpcRuntimeException(StatusUtils.java:161)
at org.apache.arrow.flight.grpc.StatusUtils.fromThrowable(StatusUtils.java:182)
at org.apache.arrow.flight.FlightStream$Observer.onError(FlightStream.java:489)
at org.apache.arrow.flight.FlightClient$1.onError(FlightClient.java:371)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:564)
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
at org.apache.arrow.flight.grpc.ClientInterceptorAdapter$FlightClientCallListener.onClose(ClientInterceptorAdapter.java:118)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:564)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:72)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:729)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:710)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
... 3 common frames omitted
Caused by: java.lang.RuntimeException: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.
at org.apache.arrow.flight.ArrowMessage.frame(ArrowMessage.java:363)
at org.apache.arrow.flight.ArrowMessage$ArrowMessageHolderMarshaller.parse(ArrowMessage.java:575)
at org.apache.arrow.flight.ArrowMessage$ArrowMessageHolderMarshaller.parse(ArrowMessage.java:560)
at io.grpc.MethodDescriptor.parseResponse(MethodDescriptor.java:284)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInternal(ClientCallImpl.java:657)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:644)
... 5 common frames omitted
Caused by: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.
at com.google.protobuf.InvalidProtocolBufferException.truncatedMessage(InvalidProtocolBufferException.java:92)
at com.google.protobuf.CodedInputStream.readRawVarint32(CodedInputStream.java:568)
at org.apache.arrow.flight.ArrowMessage.readRawVarint32(ArrowMessage.java:369)
at org.apache.arrow.flight.ArrowMessage.frame(ArrowMessage.java:290)
... 10 common frames omitted

@adampolomskiadampolomski changed the title Empty stream double check.MINOR: Empty stream double check.May 9, 2025
@github-actions

This comment has been minimized.

@lidavidmlidavidm added the bug-fix PRs that fix a big. label May 9, 2025
@lidavidmlidavidm added this to the 18.4.0 milestone May 9, 2025

@lidavidmlidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@lidavidmlidavidm changed the title MINOR: Empty stream double check.MINOR: Empty stream double checkMay 14, 2025
@lidavidm

Copy link
Copy Markdown
Member

Hmm...I would say the integration failure is unrelated but I'm not seeing it in any other PRs.

@lidavidm

Copy link
Copy Markdown
Member

But this only touches Flight so it does seem to be a flake, let me re-run...

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fixPRs that fix a big.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@adampolomski@lidavidm