Add lock expiry handler to expire state locks (#8562)

This commit is contained in:
Harshavardhana
2019-11-25 16:39:43 -08:00
committed by GitHub
parent e542084c37
commit 720442b1a2
7 changed files with 182 additions and 7 deletions

View File

@@ -109,9 +109,9 @@ func (rpcClient *ReconnectRPCClient) Unlock(args LockArgs) (status bool, err err
return status, err
}
func (rpcClient *ReconnectRPCClient) ForceUnlock(args LockArgs) (status bool, err error) {
err = rpcClient.Call("Dsync.ForceUnlock", &args, &status)
return status, err
func (rpcClient *ReconnectRPCClient) Expired(args LockArgs) (expired bool, err error) {
err = rpcClient.Call("Dsync.Expired", &args, &expired)
return expired, err
}
func (rpcClient *ReconnectRPCClient) String() string {

View File

@@ -51,6 +51,9 @@ type NetLocker interface {
// * an error on failure of unlock request operation.
Unlock(args LockArgs) (bool, error)
// Expired returns if current lock args has expired.
Expired(args LockArgs) (bool, error)
// Returns underlying endpoint of this lock client instance.
String() string