Log and trap/ignore gc errors during swap

This commit is contained in:
Shane Kilkelly 2019-05-23 11:14:02 +01:00
parent 980a2ab98f
commit f237efa6d5

View file

@ -162,7 +162,11 @@ public class SwapJobImpl implements SwapJob {
Preconditions.checkNotNull(projName, "projName was null"); Preconditions.checkNotNull(projName, "projName was null");
Log.info("Evicting project: {}", projName); Log.info("Evicting project: {}", projName);
try (LockGuard __ = lock.lockGuard(projName)) { try (LockGuard __ = lock.lockGuard(projName)) {
try {
repoStore.gcProject(projName); repoStore.gcProject(projName);
} catch (Exception e) {
Log.error("[{}] Exception while running gc on project: {}", projName, e);
}
long[] sizePtr = new long[1]; long[] sizePtr = new long[1];
try (InputStream blob = repoStore.bzip2Project(projName, sizePtr)) { try (InputStream blob = repoStore.bzip2Project(projName, sizePtr)) {
swapStore.upload(projName, blob, sizePtr[0]); swapStore.upload(projName, blob, sizePtr[0]);