mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
Improve namespace lock API: (#3203)
- abstract out instrumentation information. - use separate lockInstance type that encapsulates the nsMutex, volume, path and opsID as the frontend or top-level lock object.
This commit is contained in:
committed by
Harshavardhana
parent
3e67bfcc88
commit
dd0698d14c
@@ -386,7 +386,8 @@ func TestLockStats(t *testing.T) {
|
||||
func TestNamespaceForceUnlockTest(t *testing.T) {
|
||||
|
||||
// Create lock.
|
||||
nsMutex.Lock("bucket", "object", "11-11")
|
||||
lock := nsMutex.NewNSLock("bucket", "object")
|
||||
lock.Lock()
|
||||
// Forcefully unlock lock.
|
||||
nsMutex.ForceUnlock("bucket", "object")
|
||||
|
||||
@@ -394,7 +395,8 @@ func TestNamespaceForceUnlockTest(t *testing.T) {
|
||||
|
||||
go func() {
|
||||
// Try to claim lock again.
|
||||
nsMutex.Lock("bucket", "object", "22-22")
|
||||
anotherLock := nsMutex.NewNSLock("bucket", "object")
|
||||
anotherLock.Lock()
|
||||
// And signal succes.
|
||||
ch <- struct{}{}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user