Bug fix for cleanupLease logic -- not check child shards when cleanup is disabled

This commit is contained in:
Qilin Jin 2022-04-28 14:30:56 -07:00
parent 8dceb3f80f
commit b1cc74ee4a

View file

@ -238,7 +238,7 @@ public class LeaseCleanupManager {
} else {
cleanupFailureReason = "Configuration/Interval condition not satisfied to execute lease cleanup this cycle";
}
if (!cleanedUpCompletedLease && !alreadyCheckedForGarbageCollection && timeToCheckForGarbageShard) {
if (cleanupLeasesUponShardCompletion && !cleanedUpCompletedLease && !alreadyCheckedForGarbageCollection && timeToCheckForGarbageShard) {
// throws ResourceNotFoundException
wereChildShardsPresent = !CollectionUtils
.isNullOrEmpty(getChildShardsFromService(shardInfo));