pitrou commented on code in PR #36517:
URL: https://github.com/apache/arrow/pull/36517#discussion_r1287220502


##########
cpp/src/arrow/flight/transport/grpc/grpc_client.cc:
##########
@@ -702,10 +828,22 @@ class GrpcClientImpl : public internal::ClientTransport {
     stub_ = pb::FlightService::NewStub(
         ::grpc::experimental::CreateCustomChannelWithInterceptors(
             grpc_uri.str(), creds, args, std::move(interceptors)));
+
+#ifdef GRPC_ENABLE_ASYNC
+    garbage_bin_ = std::make_shared<GrpcGarbageBin>();
+#endif
+
     return Status::OK();
   }
 
   Status Close() override {
+#ifdef GRPC_ENABLE_ASYNC
+    // XXX: if there are async RPCs running when the client is
+    // stopped, then when they go to use the garbage bin, they'll
+    // instead synchronously dispose of resources from the callback
+    // thread, and will likely crash.

Review Comment:
   A global queue could be fine, assuming gRPC is ok with reactors still being 
in flight even though the gRPC client has been closed?
   
   Otherwise, yes, we could cancel all pending RPCs in `Client::Close` and wait 
for them to finish.



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