Merge pull request #78 from ashwing/ltr_1_rnf_log
Log details of ResourceNotFoundException while cleaning up leases
This commit is contained in:
commit
f46bd444d4
1 changed files with 4 additions and 4 deletions
|
|
@ -210,7 +210,7 @@ public class LeaseCleanupManager {
|
||||||
}
|
}
|
||||||
} catch (ResourceNotFoundException e) {
|
} catch (ResourceNotFoundException e) {
|
||||||
wasResourceNotFound = true;
|
wasResourceNotFound = true;
|
||||||
cleanedUpGarbageLease = cleanupLeaseForGarbageShard(lease);
|
cleanedUpGarbageLease = cleanupLeaseForGarbageShard(lease, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new LeaseCleanupResult(cleanedUpCompletedLease, cleanedUpGarbageLease, wereChildShardsPresent,
|
return new LeaseCleanupResult(cleanedUpCompletedLease, cleanedUpGarbageLease, wereChildShardsPresent,
|
||||||
|
|
@ -242,8 +242,8 @@ public class LeaseCleanupManager {
|
||||||
|
|
||||||
// A lease that ended with SHARD_END from ResourceNotFoundException is safe to delete if it no longer exists in the
|
// A lease that ended with SHARD_END from ResourceNotFoundException is safe to delete if it no longer exists in the
|
||||||
// stream (known explicitly from ResourceNotFound being thrown when processing this shard),
|
// stream (known explicitly from ResourceNotFound being thrown when processing this shard),
|
||||||
private boolean cleanupLeaseForGarbageShard(Lease lease) throws DependencyException, ProvisionedThroughputException, InvalidStateException {
|
private boolean cleanupLeaseForGarbageShard(Lease lease, Throwable e) throws DependencyException, ProvisionedThroughputException, InvalidStateException {
|
||||||
log.info("Deleting lease {} as it is not present in the stream.", lease);
|
log.warn("Deleting lease {} as it is not present in the stream.", lease, e);
|
||||||
leaseCoordinator.leaseRefresher().deleteLease(lease);
|
leaseCoordinator.leaseRefresher().deleteLease(lease);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -333,7 +333,7 @@ public class LeaseCleanupManager {
|
||||||
garbageLeaseCleanedUp |= leaseCleanupResult.cleanedUpGarbageLease();
|
garbageLeaseCleanedUp |= leaseCleanupResult.cleanedUpGarbageLease();
|
||||||
|
|
||||||
if (leaseCleanupResult.leaseCleanedUp()) {
|
if (leaseCleanupResult.leaseCleanedUp()) {
|
||||||
log.debug("Successfully cleaned up lease {} for {}", leaseKey, streamIdentifier);
|
log.info("Successfully cleaned up lease {} for {} due to {}", leaseKey, streamIdentifier, leaseCleanupResult);
|
||||||
deletionSucceeded = true;
|
deletionSucceeded = true;
|
||||||
} else {
|
} else {
|
||||||
log.warn("Unable to clean up lease {} for {} due to {}", leaseKey, streamIdentifier, leaseCleanupResult);
|
log.warn("Unable to clean up lease {} for {} due to {}", leaseKey, streamIdentifier, leaseCleanupResult);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue