MCPcopy Create free account
hub / github.com/PostHog/duckgres / recoverClientPanic

Function recoverClientPanic

server/flightclient/flight_executor.go:160–168  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

158// Flight SQL client. The client is NOT closed when this executor is closed.
159// This avoids creating a new gRPC connection per session.
160func 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.
166func 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{

Callers 4

QueryContextMethod · 0.85
ExecContextMethod · 0.85
waitForSessionIdleMethod · 0.85
releaseQueryHandleMethod · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected