updating wereChildShardsPresent hint in all cases

This commit is contained in:
Ashwin Giridharan 2020-06-15 23:13:47 -07:00
parent 4d65f56038
commit 374e47b208

View file

@ -173,9 +173,10 @@ public class LeaseCleanupManager {
try { try {
childShardKeys = getChildShardsFromService(shardInfo, streamIdentifier); childShardKeys = getChildShardsFromService(shardInfo, streamIdentifier);
if (childShardKeys == null) { if (CollectionUtils.isNullOrEmpty(childShardKeys)) {
log.error("No child shards returned from service for shard {} for {}.", shardInfo.shardId(), streamIdentifier.streamName()); log.error("No child shards returned from service for shard {} for {}.", shardInfo.shardId(), streamIdentifier.streamName());
} else { } else {
wereChildShardsPresent = true;
updateLeaseWithChildShards(leasePendingDeletion, childShardKeys); updateLeaseWithChildShards(leasePendingDeletion, childShardKeys);
} }
} catch (ExecutionException e) { } catch (ExecutionException e) {
@ -183,6 +184,8 @@ public class LeaseCleanupManager {
} finally { } finally {
alreadyCheckedForGarbageCollection = true; alreadyCheckedForGarbageCollection = true;
} }
} else {
wereChildShardsPresent = true;
} }
cleanedUpCompletedLease = cleanupLeaseForCompletedShard(lease, shardInfo, childShardKeys); cleanedUpCompletedLease = cleanupLeaseForCompletedShard(lease, shardInfo, childShardKeys);
} }