Check if lock owner is finished on lock acquisition

Sometimes requests "die" suddenly, without going through catch/finally blocks.
If this happens, any lock they own will remain locked until it times out (which
can take hours in some cases).

This cl implicitly unlocks any lock if the owner of the lock isn't running
anymore.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168880938
This commit is contained in:
guyben 2017-09-15 13:38:01 -07:00 committed by jianglai
parent d7214b58fc
commit 892424b148
10 changed files with 388 additions and 164 deletions

View file

@ -28,7 +28,7 @@ import google.registry.request.HttpException.BadRequestException;
import google.registry.request.HttpException.UnsupportedMediaTypeException;
import google.registry.request.auth.AuthResult;
import google.registry.request.lock.LockHandler;
import google.registry.request.lock.LockHandlerPassthrough;
import google.registry.request.lock.LockHandlerImpl;
import google.registry.util.RequestStatusChecker;
import google.registry.util.RequestStatusCheckerImpl;
import java.io.IOException;
@ -127,7 +127,7 @@ public final class RequestModule {
}
@Provides
static LockHandler provideLockHandler(LockHandlerPassthrough lockHandler) {
static LockHandler provideLockHandler(LockHandlerImpl lockHandler) {
return lockHandler;
}