You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2019/03/21 18:34:21 UTC
[arrow] branch master updated: ARROW-4984: Check if Flight gRPC
server starts properly
This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 8fc292a ARROW-4984: Check if Flight gRPC server starts properly
8fc292a is described below
commit 8fc292a24c99c51bdb18365a66ea21803690f788
Author: David Li <Da...@twosigma.com>
AuthorDate: Thu Mar 21 13:34:12 2019 -0500
ARROW-4984: Check if Flight gRPC server starts properly
Otherwise segfaults.
Annoying to reproduce - gRPC sets SO_REUSEPORT by default so it'll "just work" unless you specifically disable that.
Author: David Li <Da...@twosigma.com>
Closes #4002 from lihalite/arrow-4984 and squashes the following commits:
1b433dae0 <David Li> ARROW-4984: Check if Flight gRPC server starts properly
---
cpp/src/arrow/flight/server.cc | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/cpp/src/arrow/flight/server.cc b/cpp/src/arrow/flight/server.cc
index d1977a3..5a8dc7e 100644
--- a/cpp/src/arrow/flight/server.cc
+++ b/cpp/src/arrow/flight/server.cc
@@ -363,6 +363,9 @@ Status FlightServerBase::Init(int port) {
builder.RegisterService(impl_->service_.get());
impl_->server_ = builder.BuildAndStart();
+ if (!impl_->server_) {
+ return Status::UnknownError("Server did not start properly");
+ }
return Status::OK();
}
@@ -373,6 +376,10 @@ Status FlightServerBase::SetShutdownOnSignals(const std::vector<int> sigs) {
}
Status FlightServerBase::Serve() {
+ if (!impl_->server_) {
+ return Status::UnknownError("Server did not start properly");
+ }
+
impl_->got_signal_ = 0;
impl_->running_instance_ = impl_.get();
@@ -392,7 +399,6 @@ Status FlightServerBase::Serve() {
impl_->old_signal_handlers_.push_back(old_handler);
}
- // TODO(wesm): How can we tell if the server failed to start for some reason?
impl_->server_->Wait();
impl_->running_instance_ = nullptr;