Skip to contentSkip to conversation

asyncrpc: Use client timeout for websocket open timeout

PATCH New Joshua Watt 1 participant 1 message Jun 3, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 asyncrpc: Use client timeout for websocket open timeout

The default connection timeout for websockets is 10 seconds, so use the provided client timeout instead (which defaults to 30 seconds).

---
 bitbake/lib/bb/asyncrpc/client.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
bitbake/lib/bb/asyncrpc/client.py +5 -1
index 11179b0fcbe..9be49261c0f 100644
@@ -112,7 +112,11 @@ class AsyncClient(object):
             )
 
         async def connect_sock():
-            websocket = await websockets.connect(uri, ping_interval=None)
+            websocket = await websockets.connect(
+                uri,
+                ping_interval=None,
+                open_timeout=self.timeout,
+            )
             return WebsocketConnection(websocket, self.timeout)
 
         self._connect_sock = connect_sock
Signature · 1 line
2.43.2