Skip to content

add CancelledError to list of exceptions caught in terminate #11821

Closed

Description

@zzzeek

Discussed in #11761

diff --git a/lib/sqlalchemy/dialects/postgresql/asyncpg.py b/lib/sqlalchemy/dialects/postgresql/asyncpg.py
index cb6b75154..40794e1dd 100644
--- a/lib/sqlalchemy/dialects/postgresql/asyncpg.py
+++ b/lib/sqlalchemy/dialects/postgresql/asyncpg.py
@@ -902,6 +902,7 @@ class AsyncAdapt_asyncpg_connection(AsyncAdapt_dbapi_connection):
                 await_(self._connection.close(timeout=2))
             except (
                 asyncio.TimeoutError,
+                asyncio.CancelledError,
                 OSError,
                 self.dbapi.asyncpg.PostgresError,
             ):

Activity

  1. added
    bugSomething isn't working
    near-term releaseaddition to the milestone which indicates this should be in a near-term release
    on Sep 2, 2024
  2. added this to the 2.0.x milestone on Sep 2, 2024
  3. sqla-tester commented on Sep 2, 2024

    @sqla-tester
    Collaborator

    Mike Bayer has proposed a fix for this issue in the main branch:

    add asyncio.CancelledError to terminate conditions https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/5482

  4. sqla-tester commented on Sep 2, 2024

    @sqla-tester
    Collaborator

    Mike Bayer has proposed a fix for this issue in the rel_2_0 branch:

    add asyncio.CancelledError to terminate conditions https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/5483

  5. added a commit that references this issue on Sep 3, 2024
    4107f63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    asynciobugSomething isn't workingnear-term releaseaddition to the milestone which indicates this should be in a near-term releasepostgresql

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions