Hi, Carrying on from this thread: https://mail-archives.apache.org/mod_mbox/arrow-dev/202010.mbox/%3CCAJPUwMA25jprszWEsrL2zr0xz%3DgsqdB%3D_4jP06eG8S8b5--mdg%40mail.gmail.com%3E (apologies, as I was not a member of the list at the time of this thread starting and am unsure if it's possible to reply directly after the fact), I think there are a few options we can use to manage session lifetimes.
As Wes suggested, we could add some RPC calls, but given that FlightServer (as I understand it) is meant to be stateless by default it seems odd that we would elevate these to top-level RPC calls. An alternative would be to build on https://issues.apache.org/jira/browse/ARROW-10427 and, when using session headers, to allow the specification of an optional close handler for the FlightServer. This would then add a "close" Action to the server which would invoke the closeHandler for release of the session resources. We would then maintain a clear distinction between stateless FlightServers and those that opt into session headers where there may be state, and the ability to close would be restricted to when state is implied. Feedback on the idea would be appreciated. *Kyle Porter*