]> 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:22:24 +0000 (00:22 +0200)
commit0f9dd34d704b3cbc11bb59fb92e315fcfda366bf
tree84878f42c4017b561a5ff6b853d57c7dc5616feb
parent4e2a9396bf5fddaf37c2084668435ee6250480df
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