Skip to content

Commit 4ed8968

Browse files
author
James William Pye
committed
Check for closed connections before select()'ing.
1 parent 550f4b4 commit 4ed8968

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

postgresql/notifyman.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ def _wait_on_wires(self, time = time, select = select):
7171

7272
# Connections already marked as "bad" should not be checked.
7373
check = self.connections - self.garbage
74+
for db in check:
75+
if db.closed:
76+
self.connections.remove(db)
77+
self.garbage.add(db)
78+
check = self.connections - self.garbage
7479

7580
r, w, x = select(check, (), check, max_duration)
7681
# Make sure the connection's _notifies get filled.

0 commit comments

Comments
 (0)