From: Daniele Varrazzo Date: Sun, 12 Jun 2022 09:09:42 +0000 (+0200) Subject: fix: sync pipeline before rollback() X-Git-Tag: 3.1~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3acc1d2136a7a7b0276c53c23d789cc3a0b8dd6f;p=thirdparty%2Fpsycopg.git fix: sync pipeline before rollback() We were syncing it already, but only if we had received a "pipeline aborted" already. This might be not the case, as probably the tests test_errors_raised_on_commit which has been failing in CI randomly for weeks has been trying to say. Other similar branches (e.g. on commit) don't have the same check for aborted state. --- diff --git a/psycopg/psycopg/connection.py b/psycopg/psycopg/connection.py index daeae3e0f..d0417c44c 100644 --- a/psycopg/psycopg/connection.py +++ b/psycopg/psycopg/connection.py @@ -557,7 +557,7 @@ class BaseConnection(Generic[Row]): ) # Get out of a "pipeline aborted" state - if self._pipeline and self.pgconn.pipeline_status == ABORTED: + if self._pipeline: yield from self._pipeline._sync_gen() if self.pgconn.transaction_status == IDLE: