]> git.ipfire.org Git - thirdparty/psycopg.git/commit
fix: collect notifies only if no handler was registered
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 14 May 2025 15:16:03 +0000 (17:16 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 6 Sep 2025 22:16:31 +0000 (00:16 +0200)
commit5cc99d65f05844413730cdada00840bf9739e293
tree0ea4396c4a2e1d789e151a0cd68bc257ba64675d
parent111f7863b760b3dcca87e84f84b374a48ef88f4c
fix: collect notifies only if no handler was registered

If someone is listening to notifications by using an handler, the
notifies backlog would fill without ever being emptied.

This change has the risk of breaking something if someone is relying on
notifies being received both via callback and via generator, but I don't
know how to satisfy it without creating a leak to users who don't use the
generator. Will ask around...

Fix #1091.
psycopg/psycopg/_connection_base.py
tests/test_notify.py
tests/test_notify_async.py