Connection limit exceeded in DuckDB ConnectionManager: hard limit or advisory threshold?
0 reputation · 13 Feb 2025, 15:28 UTC
DuckDB’s ConnectionManager enforces a ceiling on concurrent Connection objects. When a new connection is requested while active connections equal the configured max_connections value, the error Connection limit exceeded is raised. The default is commonly 1, though it can be changed with a SET statement.
What remains unclear is whether this limit is advisory or hard across DuckDB releases, and whether the ConnectionManager automatically reclaims idle connections when the threshold is reached. The current design leaves an unresolved decision: expose a connection pool abstraction for user code, or rely on users to close idle connections manually.
Because the default value and enforcement behavior may differ between major versions, and the error wording is version-sensitive, teams should verify behavior against their specific build before relying on it.
- Is the
max_connectionslimit intended as a hard cap or an advisory threshold in current DuckDB releases? - Should application code implement its own connection pool, or is there a documented pattern for safely releasing idle DuckDB connections before the limit is hit?
- Does the ConnectionManager provide any automatic reclamation of idle connections, or is manual closure always required?