You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(server): improve statement timeout and parameter handling
- Add statement timeout configuration at pool level (pools.<pool_name>.statement_timeout)
- Add logging for statement timeout configuration during pool initialization
- Improve sync_parameters method to handle statement timeout consistently
- Document statement timeout configuration in CONFIG.md
- Change string initialization from String::from() to String::new()
- Maintain cleanup state until connection check-in for proper connection pooling
The statement timeout setting leverages PostgreSQL's native statement_timeout
parameter, allowing the database to handle query termination automatically.
This ensures reliable timeout enforcement directly at the database level,
rather than managing timeouts in the connection pooler. Pool-level settings
take precedence over user-level settings for consistent timeout enforcement
across all pool users.
Copy file name to clipboardExpand all lines: CONFIG.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -458,6 +458,16 @@ default: 3000
458
458
459
459
Connect timeout can be overwritten in the pool
460
460
461
+
### statement_timeout
462
+
463
+
```
464
+
path: pools.<pool_name>.statement_timeout
465
+
default: 0
466
+
```
467
+
468
+
Statement Timeout.
469
+
The `statement_timeout` setting controls the maximum amount of time (in milliseconds) that any query is allowed to run before being cancelled. When set, this allows Postgres to manage the statement_timeout. [See Postgres Docs](https://www.postgresql.org/docs/13/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-STATEMENT)
0 commit comments