isWorkerSessionCapError reports whether err is a worker's rejection of a new session because it already holds its configured maximum (MaxSessions). The worker maps this to gRPC ResourceExhausted with the duckdbservice message "max sessions reached (N)", which propagates through the wrapped error cha
(err error)
| 459 | // systemically broken. Surface a clear error rather than spinning. |
| 460 | return 0, nil, fmt.Errorf("create session: worker session-cap drift persisted across %d attempts: %w", maxWorkerSessionCapDriftRetries+1, lastCapDriftErr) |
| 461 | } |
| 462 | |
| 463 | // maxWorkerSessionCapDriftRetries bounds how many EXTRA fresh workers we try when |
| 464 | // a worker rejects a CP-scheduled session at its cap (one-session-per-worker |
| 465 | // accounting drift). Total attempts = this + 1. Small: a single drift is a rare |
| 466 | // race that a fresh worker fixes; persistent drift is a bug to surface, not spin on. |