]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
fix: sync pipeline before rollback()
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 12 Jun 2022 09:09:42 +0000 (11:09 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 12 Jun 2022 09:14:27 +0000 (11:14 +0200)
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.

psycopg/psycopg/connection.py

index daeae3e0f642eb28dc8e06f5623da76c2687b7ef..d0417c44c658c7a2894a069da263e68fe3a683e0 100644 (file)
@@ -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: