SetRequestedVCPUsResolver installs the worker-profile-to-vCPU resolver used for resource admission. nil means every session costs one vCPU.
(fn func(profile *WorkerProfile) (int, error))
| 177 | func (sm *SessionManager) acquireSlot(ctx context.Context) error { |
| 178 | _, err := sm.acquireConnectionSlot(ctx, 0, "", "postgres", nil) |
| 179 | return err |
| 180 | } |
| 181 | |
| 182 | func (sm *SessionManager) acquireConnectionSlot(ctx context.Context, pid int32, username string, protocol string, profile *WorkerProfile) (connectionLease, error) { |
| 183 | sm.mu.Lock() |
| 184 | if sm.lifecycle.isClosed() { |
| 185 | sm.mu.Unlock() |
| 186 | return nil, ErrSessionManagerDraining |
no outgoing calls