]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Point out in async connection about blocking DNS and solution
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 30 Aug 2021 03:31:32 +0000 (05:31 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 30 Aug 2021 03:32:51 +0000 (05:32 +0200)
docs/advanced/async.rst

index 492584fcaa8259f1e09ed0e7caae6856ee18c2b0..4f3e61a093bf204d358fe1e0a42e60ddc5b010fc 100644 (file)
@@ -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: