You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "amoghrajesh (via GitHub)" <gi...@apache.org> on 2026/09/10 08:20:31 UTC

Re: [PR] Fix DeadlockImminentError when a connection is resolved inside an async task [airflow]

amoghrajesh commented on code in PR #71890:
URL: https://github.com/apache/airflow/pull/71890#discussion_r3976998678


##########
task-sdk/src/airflow/sdk/definitions/connection.py:
##########
@@ -213,6 +215,20 @@ def get_uri(self) -> str:
 
         return uri
 
+    def get_uri(self) -> str:
+        """Generate and return connection in URI format."""
+        return self._build_uri(self.extra_dejson)
+
+    async def aget_uri(self) -> str:
+        """
+        Async version of :meth:`get_uri`, safe for use inside an async task.
+
+        Calls :meth:`aextra_dejson` so that secret masking uses ``asend()``

Review Comment:
   ```suggestion
           Calls `aextra_dejson` so that secret masking uses ``asend()``
   ```



##########
task-sdk/src/airflow/sdk/definitions/connection.py:
##########
@@ -306,6 +322,26 @@ def extra_dejson(self) -> dict:
 
         return extra
 
+    async def aextra_dejson(self) -> dict:
+        """
+        Async version of :attr:`extra_dejson`, safe for use inside an async task.
+
+        Uses :func:`~airflow.sdk.log.amask_secret` instead of the synchronous
+        ``mask_secret``, so calling this from within an async context does not
+        trigger ``DeadlockImminentError``.

Review Comment:
   We can just use normal docstrings here and throughout this PR instead of using doc specifiers like `:attr:` etc.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org