pitrou commented on a change in pull request #9633:
URL: https://github.com/apache/arrow/pull/9633#discussion_r588145650



##########
File path: cpp/src/arrow/flight/server.cc
##########
@@ -791,16 +799,30 @@ struct FlightServerBase::Impl {
 
   void DoHandleSignal(int signum) {
     got_signal_ = signum;
+#ifdef _WIN32
     server_->Shutdown();
+#else
+    int saved_errno = errno;
+    // Ignore errors - pipe is nonblocking
+    write(self_pipe_[1], "0", 1);
+    errno = saved_errno;
+#endif
   }
+
+#ifndef _WIN32
+  static void WaitForSignals(int fd) {
+    // Wait for a signal handler to write to the pipe
+    int8_t buf[1];
+    read(fd, /*buf=*/buf, /*count=*/1);

Review comment:
       This could fail with `EINTR`. Of course, presumably that's not really an 
error here :-)




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to