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

Method logQueryStarted

server/conn.go:455–466  ·  view source on GitHub ↗
(query string)

Source from the content-addressed store, hash-verified

453
454// queryContext returns a cancellable context for query execution.
455// The cancel function is registered with the server so it can be invoked
456// via a cancel request from another connection.
457// The caller must call the returned cleanup function when the query completes.
458//
459// A disconnect monitor goroutine runs for the duration of the query. It uses
460// bufio.Reader.Peek to detect client disconnects (TCP FIN/RST) while the
461// query is in-flight, without consuming any bytes from the stream. When a
462// disconnect is detected, the connection context (c.ctx) is cancelled,
463// propagating cancellation to gRPC calls on Flight SQL workers.
464//
465// In child worker processes, the context is also cancelled when the server's
466// externalCancelCh is closed (triggered by SIGUSR1 signal).
467func (c *clientConn) queryContext() (context.Context, func()) {
468 return c.queryContextInner(true)
469}

Callers 14

handleExecuteMethod · 0.95
handleCopyMethod · 0.95
handleCopyOutMethod · 0.95
handleCopyInMethod · 0.95
batchInsertRowsMethod · 0.95
openCursorMethod · 0.95
execUserSecretDDLMethod · 0.95
executeQueryDirectMethod · 0.95
executeSelectQueryMethod · 0.95

Calls 5

loggerMethod · 0.95
RedactForLogFunction · 0.92
TraceIDFromContextFunction · 0.92
DefaultFunction · 0.92
CaptureMethod · 0.65

Tested by 1