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

Method SetRequestedVCPUsResolver

controlplane/session_mgr.go:179–183  ·  view source on GitHub ↗

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))

Source from the content-addressed store, hash-verified

177func (sm *SessionManager) acquireSlot(ctx context.Context) error {
178 _, err := sm.acquireConnectionSlot(ctx, 0, "", "postgres", nil)
179 return err
180}
181
182func (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

Calls

no outgoing calls