lidavidm commented on code in PR #40071:
URL: https://github.com/apache/arrow/pull/40071#discussion_r1491824731


##########
cpp/src/arrow/flight/transport/grpc/grpc_server.cc:
##########
@@ -336,21 +406,35 @@ class GrpcServiceHandler final : public 
FlightService::Service {
       if (instance != nullptr) {
         flight_context.middleware_.push_back(instance);
         flight_context.middleware_map_.insert({factory.first, instance});
-        instance->SendingHeaders(&outgoing_headers);
       }
     }
 
+    // TODO factor this out after fixing all streaming and non-streaming 
handlers
+    if (!skip_headers) {
+      addMiddlewareHeaders(context, flight_context);
+    }
+
     return ::grpc::Status::OK;
   }
 
+  void addMiddlewareHeaders(ServerContext* context,

Review Comment:
   it might be simpler to just have this be idempotent and then you can just 
sprinkle calls to it everywhere where we return to gRPC, and call it explicitly 
in a few places?



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