Retry when prepare_sync is failed 69/282169/1
authorwn.jang <wn.jang@samsung.com>
Wed, 28 Sep 2022 00:55:08 +0000 (09:55 +0900)
committerTizen AI <ai.tzn.sec@samsung.com>
Wed, 28 Sep 2022 03:03:38 +0000 (12:03 +0900)
Change-Id: I9a96cd1254fefd746a76e6f8bb1fe2bba255293e

client/vc.c

index 2f18575feeb9e4c127989c978df634c8a47a8b3d..d0d19dbdb09f3b0a087a50d43154adcc93adf699 100644 (file)
@@ -697,13 +697,22 @@ int vc_prepare_sync(void)
        /* check state */
        RETVM_IF(state != VC_STATE_INITIALIZED, VC_ERROR_INVALID_STATE, TAG_VCC, "[ERROR] Invalid State: Current state(%d) is not 'Initialized'", state);
 
-       ret = vc_tidl_request_hello_sync();
+       ret = -1;
+       int cnt = 0;
+       while (VC_CONNECTION_RETRY_COUNT > cnt) {
+               ret= vc_tidl_request_hello_sync();
+               if (VC_ERROR_NONE == ret)
+                       break;
+               SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request hello_sync and retry, ret(%d)", ret);
+               usleep(100000);
+               cnt++;
+       }
        if (VC_ERROR_NONE != ret) {
                SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request hello_sync, ret(%d)", ret);
                return ret;
        }
 
-       int cnt = 0;
+       cnt = 0;
        while (EINA_TRUE == __vc_connect_daemon(NULL) && VC_CONNECTION_RETRY_COUNT > cnt) {
                cnt++;
        }