Skip to content

Commit

Permalink
apacheGH-41780: [C++][Flight][Benchmark] Ensure waiting server ready
Browse files Browse the repository at this point in the history
We should read from result stream to get an error of this RPC. If we
don't read from result stream, we can't detect an error of this RPC.
  • Loading branch information
kou committed May 23, 2024
1 parent 420c01a commit 4c3b56b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/src/arrow/flight/flight_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ struct PerformanceStats {
Status WaitForReady(FlightClient* client, const FlightCallOptions& call_options) {
Action action{"ping", nullptr};
for (int attempt = 0; attempt < 10; attempt++) {
if (client->DoAction(call_options, action).ok()) {
auto result_stream_result = client->DoAction(call_options, action);
if (result_stream_result.ok() && (*result_stream_result)->Drain().ok()) {
return Status::OK();
}
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
Expand Down

0 comments on commit 4c3b56b

Please sign in to comment.