raulcd commented on code in PR #47410:
URL: https://github.com/apache/arrow/pull/47410#discussion_r2296731940


##########
cpp/src/arrow/flight/transport_server.cc:
##########
@@ -188,71 +227,55 @@ class TransportMessageWriter final : public 
FlightMessageWriter {
   Status WriteMetadata(std::shared_ptr<Buffer> app_metadata) override {
     FlightPayload payload{};
     payload.app_metadata = app_metadata;
-    return WritePayload(payload);
+    ARROW_ASSIGN_OR_RAISE(auto success, stream_->WriteData(payload));
+    if (!success) {
+      return Close();
+    }
+    // Those messages are not written through the batch writer,
+    // count them separately for stats.
+    extra_metadata_messages_++;

Review Comment:
   I am adding them to the total number of messages written : 
`write_stats.num_messages`
   They were previously added due to `WritePayload` counting them.
   I think they should be added, maybe the naming of the variable is confusing 
and should just be `extra_messages_`?



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