Without it there may be a deadlock and we would be waiting to fetch a
result that will never come.
Close #685.
.. __: https://numpy.org/doc/stable/reference/arrays.scalars.html#built-in-scalar-types
+Psycopg 3.1.18 (unreleased)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- Fix possible deadlock on pipeline exit (:ticket:`685`).
+
+
Current release
---------------
self._enqueue_sync()
yield from self._communicate_gen()
finally:
- # No need to force flush since we emitted a sync just before.
- yield from self._fetch_gen(flush=False)
+ yield from self._fetch_gen(flush=True)
def _communicate_gen(self) -> PQGen[None]:
"""Communicate with pipeline to send commands and possibly fetch