Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 105 for lockF2 (0.06 sec)

  1. cmd/namespace-lock.go

    	} else {
    		locked = nsLk.GetLock(ctx, opsID, lockSource, timeout)
    	}
    
    	if !locked { // We failed to get the lock
    		// Decrement ref count since we failed to get the lock
    		n.lockMapMutex.Lock()
    		n.lockMap[resource].ref--
    		if n.lockMap[resource].ref < 0 {
    			logger.CriticalIf(GlobalContext, errors.New("resource reference count was lower than 0"))
    		}
    		if n.lockMap[resource].ref == 0 {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Sep 29 22:40:36 UTC 2024
    - 9.2K bytes
    - Viewed (0)
  2. internal/dsync/locker.go

    package dsync
    
    import "context"
    
    // NetLocker is dsync compatible locker interface.
    type NetLocker interface {
    	// Do read lock for given LockArgs.  It should return
    	// * a boolean to indicate success/failure of the operation
    	// * an error on failure of lock request operation.
    	RLock(ctx context.Context, args LockArgs) (bool, error)
    
    	// Do write lock for given LockArgs. It should return
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Jan 18 20:44:38 UTC 2022
    - 2.7K bytes
    - Viewed (0)
  3. internal/lock/lock.go

    // Package lock - implements filesystem locking wrappers around an
    // open file descriptor.
    package lock
    
    import (
    	"errors"
    	"os"
    	"sync"
    )
    
    // ErrAlreadyLocked is returned if the underlying fd is already locked.
    var ErrAlreadyLocked = errors.New("file already locked")
    
    // RLockedFile represents a read locked file, implements a special
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Jan 02 17:15:06 UTC 2022
    - 2.5K bytes
    - Viewed (0)
  4. internal/lsync/lrwmutex.go

    	const isWriteLock = false
    	return lm.lockLoop(ctx, id, source, timeout, isWriteLock)
    }
    
    func (lm *LRWMutex) lock(id, source string, isWriteLock bool) (locked bool) {
    	lm.mu.Lock()
    	defer lm.mu.Unlock()
    
    	lm.id = id
    	lm.source = source
    	if isWriteLock {
    		if lm.ref == 0 && !lm.isWriteLock {
    			lm.ref = 1
    			lm.isWriteLock = true
    			locked = true
    		}
    	} else {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Jan 02 17:15:06 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  5. internal/dsync/lock-args.go

    // LockArgs is minimal required values for any dsync compatible lock operation.
    type LockArgs struct {
    	// Unique ID of lock/unlock request.
    	UID string
    
    	// Resources contains single or multiple entries to be locked/unlocked.
    	Resources []string
    
    	// Owner represents unique ID for this instance, an owner who originally requested
    	// the locked resource, useful primarily in figuring out stale locks.
    	Owner string
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Jul 24 10:24:01 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  6. cmd/shared-lock.go

    	for {
    		locker := objAPI.NewNSLock(minioMetaBucket, lockName)
    		lkctx, err := locker.GetLock(ctx, sharedLockTimeout)
    		if err != nil {
    			continue
    		}
    
    	keepLock:
    		for {
    			select {
    			case <-ctx.Done():
    				return
    			case <-lkctx.Context().Done():
    				// The context of the lock is canceled, this can happen
    				// if one lock lost quorum due to cluster instability
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Feb 13 09:26:38 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  7. cmd/lock-rest-server-common_test.go

    		TimeLastRefresh: UTCNow().UnixNano(),
    	}
    
    	locker.ll.lockMap["name"] = []lockRequesterInfo{
    		lockRequesterInfo1,
    		lockRequesterInfo2,
    	}
    
    	lri := locker.ll.lockMap["name"]
    
    	// test unknown uid
    	if locker.ll.removeEntry("name", dsync.LockArgs{
    		Owner: "owner",
    		UID:   "unknown-uid",
    	}, &lri) {
    		t.Errorf("Expected %#v, got %#v", false, true)
    	}
    
    	if !locker.ll.removeEntry("name", dsync.LockArgs{
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Jul 24 10:24:01 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  8. internal/lsync/lrwmutex_test.go

    		lrwm.RUnlock()
    		// fmt.Println("1st read lock released, waiting...")
    	}()
    
    	go func() {
    		time.Sleep(3 * time.Second)
    		lrwm.RUnlock()
    		// fmt.Println("2nd read lock released, waiting...")
    	}()
    
    	// fmt.Println("Trying to acquire write lock, waiting...")
    	locked = lrwm.GetLock(ctx, "", "", duration)
    	if locked {
    		// fmt.Println("Write lock acquired, waiting...")
    		time.Sleep(1 * time.Second)
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Mar 05 04:57:35 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  9. cmd/lock-rest-server.go

    		dst.Code = dsync.RespErr
    		dst.Err = err.Error()
    	}
    	return dst, nil
    }
    
    const (
    	// Lock maintenance interval.
    	lockMaintenanceInterval = 1 * time.Minute
    
    	// Lock validity duration
    	lockValidityDuration = 1 * time.Minute
    )
    
    // lockMaintenance loops over all locks and discards locks
    // that have not been refreshed for some time.
    func lockMaintenance(ctx context.Context) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jul 29 18:10:04 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  10. internal/dsync/dsync-server_test.go

    	}
    
    	l.mutex.Lock()
    	defer l.mutex.Unlock()
    	var locksHeld int64
    	if locksHeld, reply = l.lockMap[args.Resources[0]]; !reply { // No lock is held on the given name
    		return false, fmt.Errorf("Unlock attempted on an unlocked entity: %s", args.Resources[0])
    	}
    	if reply = locksHeld == WriteLock; !reply { // Unless it is a write lock
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jan 23 16:46:37 UTC 2023
    - 8.3K bytes
    - Viewed (0)
Back to top