FlightExecutor implements QueryExecutor backed by an Arrow Flight SQL client. It routes queries to a duckdb-service worker process over a Unix socket.
| 47 | queryLogMaxInFlight = 64 |
| 48 | ) |
| 49 | |
| 50 | // ErrWorkerDead is returned when the backing worker process has crashed. |
| 51 | var 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. |
| 56 | type QueryLogLimiter struct { |
| 57 | limit int64 |
| 58 | inFlight atomic.Int64 |
| 59 | } |
| 60 | |
| 61 | // NewQueryLogLimiter creates a limiter with the production per-worker limit. |
| 62 | func NewQueryLogLimiter() *QueryLogLimiter { |
| 63 | return newQueryLogLimiter(queryLogMaxInFlight) |
| 64 | } |
| 65 | |
| 66 | func newQueryLogLimiter(limit int64) *QueryLogLimiter { |
| 67 | if limit <= 0 { |
| 68 | limit = 1 |
| 69 | } |
| 70 | return &QueryLogLimiter{limit: limit} |
| 71 | } |
nothing calls this directly
no outgoing calls
no test coverage detected