WorkerPodNameForPID returns the K8s pod name of the worker hosting the session, or "" if not found or not running on K8s.
(pid int32)
| 976 | // applies at reap time (the caller resolves it). |
| 977 | func (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 |
no test coverage detected