@ -247,42 +247,43 @@ func lockMaintenance(ctx context.Context, interval time.Duration, objAPI ObjectL
// Get list of long lived locks to check for staleness.
// Get list of long lived locks to check for staleness.
for lendpoint , nlrips := range getLongLivedLocks ( interval ) {
for lendpoint , nlrips := range getLongLivedLocks ( interval ) {
for _ , nlrip := range nlrips {
for _ , nlrip := range nlrips {
for _ , ep := range globalEndpoints {
// Locks are only held on first zone, make sure that
for _ , endpoint := range ep . Endpoints {
// we only look for ownership of locks from endpoints
if endpoint . String ( ) == lendpoint . String ( ) {
// on first zone.
continue
for _ , endpoint := range globalEndpoints [ 0 ] . Endpoints {
}
if endpoint . String ( ) == lendpoint . String ( ) {
continue
c := newLockAPI ( endpoint )
}
if ! c . IsOnline ( ) {
continue
c := newLockAPI ( endpoint )
}
if ! c . IsOnline ( ) {
continue
// Call back to original server verify whether the lock is
}
// still active (based on name & uid)
expired , err := c . Expired ( dsync . LockArgs {
// Call back to original server verify whether the lock is
UID : nlrip . lri . UID ,
// still active (based on name & uid)
Resources : [ ] string { nlrip . name } ,
expired , err := c . Expired ( dsync . LockArgs {
} )
UID : nlrip . lri . UID ,
Resources : [ ] string { nlrip . name } ,
if err != nil {
} )
c . Close ( )
continue
if err != nil {
}
// For successful response, verify if lock was indeed active or stale.
if expired {
// The lock is no longer active at server that originated
// the lock, attempt to remove the lock.
globalLockServers [ lendpoint ] . mutex . Lock ( )
// Purge the stale entry if it exists.
globalLockServers [ lendpoint ] . removeEntryIfExists ( nlrip )
globalLockServers [ lendpoint ] . mutex . Unlock ( )
}
// Close the connection regardless of the call response.
c . Close ( )
c . Close ( )
continue
}
// For successful response, verify if lock was indeed active or stale.
if expired {
// The lock is no longer active at server that originated
// the lock, attempt to remove the lock.
globalLockServers [ lendpoint ] . mutex . Lock ( )
// Purge the stale entry if it exists.
globalLockServers [ lendpoint ] . removeEntryIfExists ( nlrip )
globalLockServers [ lendpoint ] . mutex . Unlock ( )
}
}
// Close the connection regardless of the call response.
c . Close ( )
}
}
}
}
}
}