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

Struct FlightExecutor

server/flightclient/flight_executor.go:49–68  ·  view source on GitHub ↗

FlightExecutor implements QueryExecutor backed by an Arrow Flight SQL client. It routes queries to a duckdb-service worker process over a Unix socket.

Source from the content-addressed store, hash-verified

47 queryLogMaxInFlight = 64
48)
49
50// ErrWorkerDead is returned when the backing worker process has crashed.
51var ErrWorkerDead = errors.New("flight worker is dead")
52
53// QueryLogLimiter bounds concurrent control-plane query-log RPCs for one
54// worker. It holds no entries itself; sessions sharing a worker share the
55// same limiter so a stalled endpoint cannot accumulate unbounded goroutines.
56type QueryLogLimiter struct {
57 limit int64
58 inFlight atomic.Int64
59}
60
61// NewQueryLogLimiter creates a limiter with the production per-worker limit.
62func NewQueryLogLimiter() *QueryLogLimiter {
63 return newQueryLogLimiter(queryLogMaxInFlight)
64}
65
66func newQueryLogLimiter(limit int64) *QueryLogLimiter {
67 if limit <= 0 {
68 limit = 1
69 }
70 return &QueryLogLimiter{limit: limit}
71}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected