RobertLD commented on code in PR #49771:
URL: https://github.com/apache/arrow/pull/49771#discussion_r4221826753


##########
cpp/src/arrow/ipc/message.cc:
##########
@@ -1051,6 +1051,19 @@ class InputStreamMessageReader : public MessageReader, 
public MessageDecoderList
 
   Status OnMessageDecoded(std::unique_ptr<Message> message) override {
     message_ = std::move(message);
+    first_message_ = false;
+    return Status::OK();
+  }
+
+  Status OnMetadata() override {
+    // An IPC file starts with "ARROW1". Read as a stream, its first four bytes
+    // ("ARRO") decode as a metadata length of 0x4F525241.
+    constexpr int64_t kArrowMagicAsMetadataLength = 0x4F525241;
+    if (first_message_ && decoder_.next_required_size() == 
kArrowMagicAsMetadataLength) {

Review Comment:
   I don't think this is a legitimate concern, the prior error message message 
is even less informative. Earlier discussion with @pitrou, if I recall, settled 
on an explicit error over the whole peeking and resyncing business. 



-- 
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]

Reply via email to