(waiter *connectionWaiter)
| 314 | // CreateSession acquires a worker from the configured pool, creates a session |
| 315 | // on it, and rebalances memory/thread limits across all active sessions. |
| 316 | // If pid is 0, a new one is generated. |
| 317 | func (sm *SessionManager) CreateSession(ctx context.Context, username string, pid int32, memoryLimit string, threads int, profile *WorkerProfile) (int32, *flightclient.FlightExecutor, error) { |
| 318 | return sm.CreateSessionWithProtocol(ctx, username, pid, memoryLimit, threads, "postgres", profile) |
| 319 | } |
| 320 | |
| 321 | func (sm *SessionManager) CreateSessionWithProtocol(ctx context.Context, username string, pid int32, memoryLimit string, threads int, protocol string, profile *WorkerProfile) (resultPID int32, resultExecutor *flightclient.FlightExecutor, resultErr error) { |
| 322 | ctx, finishCreation, err := sm.beginSessionCreation(ctx) |
| 323 | if err != nil { |
| 324 | return 0, nil, err |
| 325 | } |
| 326 | defer func() { |
| 327 | if !finishCreation() { |
| 328 | return |
no outgoing calls
no test coverage detected