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

Method WorkerPodNameForPID

controlplane/session_mgr.go:978–990  ·  view source on GitHub ↗

WorkerPodNameForPID returns the K8s pod name of the worker hosting the session, or "" if not found or not running on K8s.

(pid int32)

Source from the content-addressed store, hash-verified

976// applies at reap time (the caller resolves it).
977func (sm *SessionManager) WorkerTTLForPID(pid int32) (time.Duration, bool) {
978 sm.mu.RLock()
979 s, ok := sm.sessions[pid]
980 sm.mu.RUnlock()
981 if !ok {
982 return 0, false
983 }
984 pool, ok := sm.pool.(workerTTLPool)
985 if !ok {
986 return 0, false
987 }
988 return pool.WorkerTTL(s.WorkerID)
989}
990
991// SessionForWorker returns the session bound to the given cluster-unique worker
992// id, or ok=false if this stack has none. One session per worker, so the first
993// (only) pid in the worker's index is authoritative. Used by the admin

Callers 1

handleConnectionMethod · 0.95

Calls 2

WorkerMethod · 0.65
PodNameMethod · 0.45

Tested by

no test coverage detected