From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:48 +0000 (-0700) Subject: lib/file: Add a comment on why sleeps for file locks are randomized X-Git-Tag: stable-10.2.0~129 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=564668d513a4fdb595fd4440f4e640c752c24e12;p=thirdparty%2Fopen-vm-tools.git lib/file: Add a comment on why sleeps for file locks are randomized The randomization prevents lock cadence issues (thundering herds). --- diff --git a/open-vm-tools/lib/file/fileLockPrimitive.c b/open-vm-tools/lib/file/fileLockPrimitive.c index f1a3b5212..2a64cc5b1 100644 --- a/open-vm-tools/lib/file/fileLockPrimitive.c +++ b/open-vm-tools/lib/file/fileLockPrimitive.c @@ -148,6 +148,11 @@ FileLockSleeper(LockValues *myValues) // IN/OUT: maxSleepTimeMsec = MIN(ageMsec / 10, 2000); } + /* + * Randomize the time slept. This will prevent any potential cadence issues + * (thundering herds). + */ + (void) FileSleeper(maxSleepTimeMsec / 10, maxSleepTimeMsec); return 0;