Fix cynara client sometimes getting CYNARA_API_SERVICE_NOT_AVAILABLE 58/315458/1
authorKrzysztof Malysa <k.malysa@samsung.com>
Thu, 28 Nov 2024 08:07:47 +0000 (09:07 +0100)
committerKrzysztof Malysa <k.malysa@samsung.com>
Mon, 2 Dec 2024 06:13:25 +0000 (07:13 +0100)
Due to disconnecting all clients procedure upon database update, the
just connected client could have been disconnected resulting in
CYNARA_API_SERVICE_NOT_AVAILABLE error despite cynara service being up
and running.

Now this is avoided by not checking on the client side if connection is
up just after connecting.

Change-Id: If698c5b7c76e1670edbf08882e1ed813ca38e197

src/common/sockets/Socket.cpp

index bcfe99592fd8bdaa643660c950e61984718a0bf0..a785b8bf74bf95ca319e64dec0b734945ebe89e8 100644 (file)
@@ -212,12 +212,7 @@ Socket::ConnectionStatus Socket::connect(void) {
 
     createSocket();
 
-    ConnectionStatus status = connectSocket();
-    if (status != ConnectionStatus::CONNECTION_SUCCEEDED)
-        return status;
-
-    return isConnected() ? ConnectionStatus::CONNECTION_SUCCEEDED
-                         : ConnectionStatus::CONNECTION_FAILED;
+    return connectSocket();
 }
 
 Socket::ConnectionStatus Socket::completeConnection(void) {