]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Do a 100 msec delay for each vsock channel start retry.
authorOliver Kurth <okurth@vmware.com>
Wed, 1 Apr 2020 18:31:38 +0000 (11:31 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 1 Apr 2020 18:31:38 +0000 (11:31 -0700)
Move the 100 msec delay into the vsock RPC start retry loop.  The
100 msec delay before each start retry is needed for errors that
will return quickly.

open-vm-tools/lib/rpcChannel/vsockChannel.c

index cffed9614c2b705539e0c4aea76a7505d3f5018d..66997c1b235f5cefdf1e3cd8e5fdc62af1bc555b 100644 (file)
@@ -364,17 +364,17 @@ VSockChannelStart(RpcChannel *chan)    // IN
       if (!ret && (vsock->out->flags & RPCCHANNEL_FLAGS_SEND_ONE) == 0) {
          int retryCnt = 0;
 
-         /*
-          * VMX may take some time to cleanup a previous vsocket, so delay
-          * the retry a little bit.  The retry is needed for the cases when
-          * there is a channel start attempt in quick succession and the
-          * first attempt failed because VMX was still cleaning up the
-          * previous vsocket.
-          *
-          * Take a 100 msec pause.
-          */
-         g_usleep(VSOCK_START_RETRY_WAIT_TIME * 1000);
          while (!ret && (retryCnt++ < VSOCK_CHANNEL_START_MAX_RETRIES)) {
+            /*
+             * VMX may take some time to cleanup a previous vsocket, so delay
+             * the retry a little bit.  The retry is needed for the cases when
+             * there is a channel start attempt in quick succession and the
+             * first attempt failed because VMX was still cleaning up the
+             * previous vsocket.
+             *
+             * Take a 100 msec pause.
+             */
+            g_usleep(VSOCK_START_RETRY_WAIT_TIME * 1000);
             Debug(LGPFX "VSockChannel Start - retry %d\n", retryCnt);
             ret = VSockOutStart(vsock->out);
          }