fix: reset on acquire and widen poisoned-connection detection

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qzqmh52NU8fB9RBQNNkJGt
This commit is contained in:
Ruben Fiszel
2026-08-24 16:30:50 +00:00
co-authored by Claude Opus 5
parent 6e56d99642
commit fa3de27151
5 changed files with 52 additions and 25 deletions
+4 -4
View File
@@ -153,12 +153,12 @@ pub async fn connect(
pool_options = pool_options.idle_timeout(Duration::from_secs(60));
}
pool_options
// Clears transaction state sqlx is not tracking, so a connection whose session was
// left inside a transaction is not handed to the next borrower. See
// Clears transaction state sqlx is not tracking, so a session left inside a
// transaction is cleaned before the connection is handed to a borrower. See
// `windmill_common::db::connection_reset` for how such a session comes about and why
// this only runs once one has been observed.
.after_release(|conn, _| {
Box::pin(windmill_common::db::connection_reset::reset_on_release(
.before_acquire(|conn, _| {
Box::pin(windmill_common::db::connection_reset::reset_before_acquire(
conn,
))
})