From 430b24081c6af286d0226a88454930833f9db4b6 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 9 May 2023 16:04:24 -0400 Subject: [PATCH] Have apiclient timeout if IO hangs up --- confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient | 1 + 1 file changed, 1 insertion(+) diff --git a/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient b/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient index a8b5e39b..7f6aea95 100644 --- a/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient +++ b/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient @@ -356,6 +356,7 @@ class HTTPSClient(client.HTTPConnection, object): def connect(self): addrinf = socket.getaddrinfo(self.host, self.port)[0] psock = socket.socket(addrinf[0]) + psock.settimeout(15) psock.connect(addrinf[4]) ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ctx.load_verify_locations('/etc/confluent/ca.pem')