]> git.ipfire.org Git - thirdparty/psycopg.git/commit
fix: consider a connection closed in poll() only if it's not ready too 1141/head 1183/head
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 11 Oct 2025 01:26:40 +0000 (03:26 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 13 Oct 2025 01:25:16 +0000 (03:25 +0200)
commit191a2c6bd28490f45cbbec9255843dfbee34ac59
tree89600e74ee610c8d885472e101eb7c59e4931c87
parent46d2721192b0f401aaa5280e2834bc4bb8116204
fix: consider a connection closed in poll() only if it's not ready too

When closing the proxy and trying to communicate, poll returns state 25
on the connection, i.e. POLLIN | POLLERR | POLLHUP. The connection is
not closed though, so we might end up in weird state ahead (e.g. connection
stuck in ACTIVE).

Because it's suggested that the connection is readable, do read from it.
Likely a proper error will be raised downstream, but we will remain in
consistent state.
psycopg/psycopg/waiting.py
psycopg_c/psycopg_c/_psycopg/waiting.pyx
tests/test_waiting.py
tests/test_waiting_async.py