fix(arrow/flight): skip metadata-only messages in the record reader #1549
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 262 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.333
Real PR Conversation Timeline
1 comments
"Review active on #1549"
general
weight: 0.35
ShivamSharma43
Rationale for this change
Writer.WriteMetadatasends aFlightDatamessage that hasapp_metadatabut no IPC header or body.NewRecordReaderdropped the first such message while peeking for a descriptor, but the message adapter passed any later one toipc.NewMessage. The empty header then reached the flatbuffers decoder, and reading failed with:So two heartbeats before the schema broke the stream (see #1517). A single metadata-only message between two record batches failed the same way, because
Next()hit the same decode error.What changes are included in this PR?
dataMessageReader.Message()now skips messages that have neither aDataHeadernor aDataBody. It still records anyFlightDescriptorthey carry. Messages with a header, or with a body and no header, follow the same path as before.LatestAppMetadata()still returns the metadata attached to the record batch that was read, not the metadata of a skipped heartbeat.Are these changes tested?
Yes.
TestReaderSkipsMetadataOnlyMessageswrites threeWriteMetadatamessages before the schema and one after each record batch (including after the last one). It then checks that every batch reads back equal, with its ownWriteWithAppMetadatavalue, and that the stream ends cleanly. The test fails onmainwith the error above and passes with this change.collectingFlightStreamWriternow copiesAppMetadatatoo, so the test can check it.go test ./arrow/flight/...passes, with and without-tags assert,test -short.go vet ./arrow/flight/...and gofmt are clean.Are there any user-facing changes?
Readers no longer fail on streams that contain standalone metadata messages. The record-oriented reader skips those messages.
Fixes #1517
AI assistance: I used Claude Code (Anthropic) to write this change and the test. I reviewed the code and ran the tests locally.
🤖 Generated with Claude Code