You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/13 15:46:43 UTC

[GitHub] [arrow] lupko commented on issue #11932: [Python] Unable to turn-off signal blocking for pyarrow flight RPC server

lupko commented on issue #11932:
URL: https://github.com/apache/arrow/issues/11932#issuecomment-992609540


   I run into this problem as well. What happens in my case is FlightServerBase will install its own handlers for INT & TERM. Upon those signals, none of the previously installed handlers will be called (even if it seems the code intends to do so?); Flight RPC server shuts down on those signals.
   
   Anyway, what seems like a workaround to me is to:
   
   1. set both SIGTERM and SIGINT to SIG_IGN - this way pyarrow will not register its own signal handlers (https://github.com/apache/arrow/blob/master/cpp/src/arrow/python/flight.cc#L181)
   2. start the server in separate thread, once up, install your own handlers in the main thread
   3. in your own handlers trigger shutdown explicitly; once shutdown is done blocking, the serve() will exit as well
   
   Disclaimer: i'm a newbie in pyarrow/Flight so maybe this is not 100% correct and leads to problems down the line.
   
   @lidavidm i'm curious, how about exposing the Serve() for applications that want/need to do their own signal processing and control the Flight RPC server lifecycle themselves? Seems like the underlying C++ impl has methods to do Serve() and ServeWithSignals() but python only exposes the latter.
   
   Thanks


-- 
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: github-unsubscribe@arrow.apache.org

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