GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-939: Remove reflection for gRPC buffers by xborder · Pull Request #954 · apache/arrow-java

Conversation

@xborder

@xborder xborder commented Jan 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What's Changed

  • Replace reflection-based gRPC buffer handling with FlightDataParser reading from InputStream/detached ByteBuffer, enabling zero‑copy ArrowBuf slices for app_metadata and data_body.
  • Simplify ArrowMessage.frame to use the shared parser and fallback path; remove GetReadableBuffer and add grpc-core runtime/module updates.
  • Add TestArrowMessageParse coverage for duplicate fields, zero‑copy allocation, and non‑detach fallback behavior.

Closes #939.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@xborder
xborder requested review from jbonofre, laurentgo, lidavidm and wgtmac as code owners January 11, 2026 00:31
@github-actions

This comment has been minimized.

Sign in to view
@xborder xborder changed the title GH-939: Remove relection GH-939: Remove reflection for gRPC buffers Jan 11, 2026
@xborder
xborder marked this pull request as draft January 11, 2026 00:47
@lidavidm lidavidm added the enhancement PRs that add or improve features. label Jan 11, 2026
@xborder
xborder marked this pull request as ready for review January 11, 2026 15:02
@github-actions github-actions Bot added this to the 19.0.0 milestone Jan 11, 2026
lidavidm
lidavidm reviewed Jan 12, 2026
View reviewed changes
Comment thread flight/flight-core/src/main/java/org/apache/arrow/flight/ArrowMessage.java Outdated
Comment on lines +463 to +466
if (detachedByteBuffer == null || !detachedByteBuffer.isDirect()) {
closeQuietly(detachedStream);
return null;
}

@lidavidm lidavidm Jan 12, 2026

Copy link
Copy Markdown
Member

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.

Since we detached the stream, if we give up here, aren't we erroneously going to discard the actual data? My understanding of Detachable is that the original stream is now invalid, right?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@xborder xborder Jan 12, 2026

Copy link
Copy Markdown
Contributor Author

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.

good catch. Actually this is redundant, the isDirect is already checked at the beginning of the method so I just removed it

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lidavidm
lidavidm reviewed Jan 14, 2026
View reviewed changes

@lidavidm lidavidm left a comment

Copy link
Copy Markdown
Member

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.

All builds fail:

Error:  Non-test scoped test only dependencies found:
Error:     io.grpc:grpc-core:jar:1.78.0:compile

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lidavidm
lidavidm approved these changes Jan 15, 2026
View reviewed changes

@lidavidm lidavidm left a comment

Copy link
Copy Markdown
Member

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.

Approved CI

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lidavidm

lidavidm commented Jan 15, 2026

Copy link
Copy Markdown
Member

CC @ejona86 in case you do want to look over this

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lidavidm

lidavidm commented Jan 15, 2026

Copy link
Copy Markdown
Member

@xborder it seems this doesn't actually work...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@xborder

xborder commented Jan 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@lidavidm Seems like a chicken and the egg problem. grpc-core can't be a compile dependency because it is detected as unused by CI although it is still required in runtime (AddWritableBuffer still needs it for reflection).
Marking it with a runtime scope causes the tests I created to fail because they require the dependency in compile time.

I've changed the tests to use a mock for the dependency it had on grpc-core. This seemed to have solved the issues from the two previous runs but probably diminishes the relevance of these tests

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jbonofre

jbonofre commented Jan 15, 2026

Copy link
Copy Markdown
Member

@xborder thanks for the update. Let me take a look.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@xborder

xborder commented Jan 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@lidavidm I think there's something I overlooked. frame() is iterating over the stream, if I detach it when reading APP_METADATA_TAG it invalidates the same stream it is iterating. Let me rework on this and I'll keep you posted

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jbonofre
jbonofre reviewed Jan 16, 2026
View reviewed changes
Comment thread flight/flight-core/src/main/java/org/apache/arrow/flight/ArrowMessage.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jbonofre jbonofre modified the milestones: 19.0.0, 20.0.0 Jan 23, 2026
@alespour alespour mentioned this pull request Feb 18, 2026
build(deps): bump io.grpc:grpc-bom from 1.78.0 to 1.79.0 InfluxCommunity/influxdb3-java#355
Closed
@xborder
xborder force-pushed the remove-grpc-reflection branch from 49a6815 to ce66298 Compare March 24, 2026 23:08
@xborder

xborder commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

@jbonofre I tried to reproduce this on a Windows 11 VM and couldn't. Could this be a flaky test?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@xborder
xborder force-pushed the remove-grpc-reflection branch from c6bac03 to bc07143 Compare May 12, 2026 21:17
laurentgo
laurentgo reviewed May 19, 2026
View reviewed changes
Comment thread flight/flight-core/src/main/java/org/apache/arrow/flight/ArrowMessage.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@xborder
xborder requested a review from jbonofre September 22, 2026 10:56
@xborder
xborder force-pushed the remove-grpc-reflection branch 2 times, most recently from f49f446 to 56dc96e Compare October 6, 2026 13:24
@malmeida-floe malmeida-floe mentioned this pull request Oct 21, 2026
build: upgrade Quarkus to 3.33.4 LTS, Arrow to 19.0.0 and protobuf to 4.33.4 eng-floe/floecat#578
Merged
lidavidm
lidavidm approved these changes Oct 27, 2026
View reviewed changes
@jbonofre jbonofre removed this from the 20.0.0 milestone Nov 16, 2026
xborder added 15 commits November 21, 2026 11:04
@xborder
Remove grpc-java reflection for ownership transfers
f7d04a4
@xborder
remove redundant check
ace9b4c
@xborder
set grpc-core as runtime dependency
897f75f
@xborder
mock ReadableBuffer to not depend on grpc-core
224d805
@xborder
rework frame to wrap inputstream with ArrowBuf before reading
0236fdc
@xborder
simplify ArrowBufReader decoding logic
d3ae665
@xborder
add ArrowMessage.frame tests
8283f56
@xborder
merge tests
7b3a6f1
@xborder
remove redundant checks. add test to check fallback works
3a1de52
@xborder
spotless
300a096
@xborder
Share detached buffers with downstream consumers
aa4acd7
Scope detached FlightData buffers to a message-local allocator and retain them into downstream allocators as messages are consumed
@xborder
Apply spotless formatting to ArrowMessage
8ca846a
@xborder
Honor zero-copy read disable flag
779e895
@xborder
Preserve FlightData field length validation
39f54a8
@xborder
Preserve FlightData parser semantics
272aaf7
@xborder
xborder force-pushed the remove-grpc-reflection branch from 56dc96e to 272aaf7 Compare November 21, 2026 11:11
@github-actions github-actions Bot added this to the 20.1.0 milestone Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@laurentgo laurentgo laurentgo left review comments
@lidavidm lidavidm lidavidm approved these changes
@wgtmac wgtmac Awaiting requested review from wgtmac wgtmac is a code owner
@jbonofre jbonofre Awaiting requested review from jbonofre jbonofre is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

enhancement PRs that add or improve features.

Projects

None yet

Milestone

20.1.0

Development

Successfully merging this pull request may close these issues.

[FlightRPC] Remove sketchy gRPC reflection code

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@xborder @lidavidm @jbonofre @laurentgo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.