From 1a3fa0d6d6a94ceceecdd89bba10c33e3aa87d38 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 30 Aug 2021 05:31:32 +0200 Subject: [PATCH] Point out in async connection about blocking DNS and solution --- docs/advanced/async.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/advanced/async.rst b/docs/advanced/async.rst index 492584fca..4f3e61a09 100644 --- a/docs/advanced/async.rst +++ b/docs/advanced/async.rst @@ -29,6 +29,18 @@ here and there. print(record) +.. warning:: + + `AsyncConnection.connect()` may still block on DNS name resolution. + To avoid that you should `set the hostaddr connection parameter`__. + + The `~psycopg._dns.resolve_hostaddr_async()` is an experimental solution + to help to do that. Feedback about the feature is welcome! + + .. __: https://www.postgresql.org/docs/current/libpq-connect.html + #LIBPQ-PARAMKEYWORDS + + .. index:: with .. _async-with: -- 2.47.3