recoverClientPanic converts a nil-pointer panic from a closed Flight SQL client into an error. The arrow-go Close() method nils out the embedded FlightServiceClient, so any concurrent RPC on the shared client panics. Only nil-pointer dereferences are recovered; other panics are re-raised to preserve
(err *error)
| 158 | // Flight SQL client. The client is NOT closed when this executor is closed. |
| 159 | // This avoids creating a new gRPC connection per session. |
| 160 | func NewFlightExecutorFromClient(client *flightsql.Client, sessionToken string) *FlightExecutor { |
| 161 | return NewFlightExecutorFromClientWithQueryLogLimiter(client, sessionToken, nil) |
| 162 | } |
| 163 | |
| 164 | // NewFlightExecutorFromClientWithQueryLogLimiter creates a per-session |
| 165 | // executor whose asynchronous query-log calls share a worker-wide limiter. |
| 166 | func NewFlightExecutorFromClientWithQueryLogLimiter(client *flightsql.Client, sessionToken string, limiter *QueryLogLimiter) *FlightExecutor { |
| 167 | if limiter == nil { |
| 168 | limiter = NewQueryLogLimiter() |
| 169 | } |
| 170 | ctx, cancel := context.WithCancel(context.Background()) |
| 171 | e := &FlightExecutor{ |
no test coverage detected