From: Oliver Kurth Date: Wed, 1 Apr 2020 18:34:06 +0000 (-0700) Subject: Do a 100 msec delay for each vsock channel start retry. X-Git-Tag: stable-11.1.0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b1c196d3ac08748285592fc0cb2e23012d76173;p=thirdparty%2Fopen-vm-tools.git Do a 100 msec delay for each vsock channel start retry. 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. --- diff --git a/open-vm-tools/lib/rpcChannel/vsockChannel.c b/open-vm-tools/lib/rpcChannel/vsockChannel.c index cffed9614..66997c1b2 100644 --- a/open-vm-tools/lib/rpcChannel/vsockChannel.c +++ b/open-vm-tools/lib/rpcChannel/vsockChannel.c @@ -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); }