pitrou commented on code in PR #36205:
URL: https://github.com/apache/arrow/pull/36205#discussion_r1242157632
##########
cpp/src/arrow/flight/flight_test.cc:
##########
@@ -1019,6 +1027,37 @@ TEST_F(TestFlightClient, DoAction) {
ASSERT_OK_AND_ASSIGN(result, stream->Next());
ASSERT_EQ(nullptr, result);
+
+ {
+ class Listener : public AsyncListener<Result> {
+ public:
+ void OnNext(Result result) override {
results_.push_back(std::move(result)); }
+
+ void OnFinish(TransportStatus status) override {
+ if (status.ok()) {
+ future_.MarkFinished(std::move(results_));
+ } else {
+ future_.MarkFinished(status.ToStatus());
+ }
+ }
+
+ arrow::Future<std::vector<Result>> future_ =
+ arrow::Future<std::vector<Result>>::Make();
+ std::vector<Result> results_;
+ };
+ // XXX: if you don't wait for rpc to finish, UB occurs because the
+ // subclass part of the listener will be occurred, and so gRPC
+ // will call back into OnFinish but this will be gone it will have
+ // been replaced by "pure virtual" stub
Review Comment:
Seems like a good argument to have a shared_ptr somewhere? :-)
--
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]