--- a/psycopg_pool/psycopg_pool/pool_async.py
+++ b/psycopg_pool/psycopg_pool/pool_async.py
@@ -686,6 +686,11 @@ class AsyncConnectionPool(Generic[ACT], BasePool):
             try:
                 await task.run()
             except CLIENT_EXCEPTIONS as ex:
+                if True:  # ASYNC
+                    if isinstance(ex, asyncio.CancelledError):
+                        # The worker itself is being cancelled (e.g. by
+                        # asyncio.run() shutting down): terminate.
+                        raise
                 logger.warning(
                     "task run %s failed: %s: %s", task, ex.__class__.__name__, ex
                 )
@@ -757,6 +762,15 @@ class AsyncConnectionPool(Generic[ACT], BasePool):
         try:
             conn = await self._connect()
         except CLIENT_EXCEPTIONS as ex:
+            if True:  # ASYNC
+                if isinstance(ex, asyncio.CancelledError):
+                    # Cancelled while connecting: don't schedule a retry,
+                    # let the cancellation reach the worker.
+                    async with self._lock:
+                        self._nconns -= 1
+                        if growing and self._growing:
+                            self._growing = False
+                    raise
             logger.warning("error connecting in %r: %s", self.name, ex)
             if attempt.time_to_give_up(now):
                 logger.warning(
