-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C++][Flight] Flight benchmark doesn't work anymore #41780
Comments
Hmm. It seems that
arrow-flight-perf-server isn't listen a socket.
|
That isn't surprising for gRPC; streams only give errors when finished. (Another reason not to wrap gRPC so heavily.) |
A while ago DoAction would eagerly consume all results up front (the wrong behavior!) meaning that it would give errors immediately. This was fixed by a contributor but had the side effect of breaking this kind of usage (which was wrong all along, but hidden by Flight being a heavy wrapper over another library that we don't properly understand). |
Ah, I see. The following works. Is it OK? Or do we have more simpler way? diff --git a/cpp/src/arrow/flight/flight_benchmark.cc b/cpp/src/arrow/flight/flight_benchmark.cc
index f53b1c6dce..057ef15c3c 100644
--- a/cpp/src/arrow/flight/flight_benchmark.cc
+++ b/cpp/src/arrow/flight/flight_benchmark.cc
@@ -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)); |
That should be good. |
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.
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.
### Rationale for this change 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. ### What changes are included in this PR? Call `Drain()` to detect an error. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #41780 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Issue resolved by pull request 41793 |
…pache#41793) ### Rationale for this change 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. ### What changes are included in this PR? Call `Drain()` to detect an error. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: apache#41780 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Describe the bug, including details regarding any error messages, version, and platform.
On my local build:
Component(s)
Benchmarking, C++, FlightRPC
The text was updated successfully, but these errors were encountered: