Merge pull request #63 from overleaf/sk-emergency-log-and-trap-gc-errors

Log and trap/ignore gc errors during swap
This commit is contained in:
Shane Kilkelly 2019-05-23 11:26:05 +01:00 committed by GitHub
commit 8086a1b2b4

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]);