Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for mustBlock (0.12 sec)

  1. src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go

    	defer other.Close()
    
    	lock(t, f)
    	lockOther := mustBlock(t, "Lock", other)
    	unlock(t, f)
    	lockOther(t)
    	unlock(t, other)
    }
    
    func TestLockExcludesRLock(t *testing.T) {
    	t.Parallel()
    
    	f, remove := mustTempFile(t)
    	defer remove()
    
    	other := mustOpen(t, f.Name())
    	defer other.Close()
    
    	lock(t, f)
    	rLockOther := mustBlock(t, "RLock", other)
    	unlock(t, f)
    	rLockOther(t)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 06 22:37:50 UTC 2023
    - 4K bytes
    - Viewed (0)
  2. src/cmd/go/internal/lockedfile/lockedfile_test.go

    	if err != nil {
    		t.Fatal(err)
    	}
    	return dir, func() { os.RemoveAll(dir) }
    }
    
    const (
    	quiescent            = 10 * time.Millisecond
    	probablyStillBlocked = 10 * time.Second
    )
    
    func mustBlock(t *testing.T, desc string, f func()) (wait func(*testing.T)) {
    	t.Helper()
    
    	done := make(chan struct{})
    	go func() {
    		f()
    		close(done)
    	}()
    
    	timer := time.NewTimer(quiescent)
    	defer timer.Stop()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 05 23:35:29 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  3. pilot/pkg/leaderelection/k8sleaderelection/k8sresourcelock/multilock.go

    	kerrors "k8s.io/apimachinery/pkg/api/errors"
    )
    
    const (
    	UnknownLeader = "leaderelection.k8s.io/unknown"
    )
    
    // MultiLock is used for lock's migration
    type MultiLock struct {
    	Primary   Interface
    	Secondary Interface
    }
    
    // Get returns the older election record of the lock
    func (ml *MultiLock) Get(ctx context.Context) (*LeaderElectionRecord, []byte, error) {
    	primary, primaryRaw, err := ml.Primary.Get(ctx)
    	if err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Nov 03 08:41:32 UTC 2022
    - 2.9K bytes
    - Viewed (0)
  4. pilot/pkg/leaderelection/k8sleaderelection/k8sresourcelock/interface.go

    		return configmapLock, nil
    	case LeasesResourceLock:
    		return leaseLock, nil
    	case EndpointsLeasesResourceLock:
    		return &MultiLock{
    			Primary:   endpointsLock,
    			Secondary: leaseLock,
    		}, nil
    	case ConfigMapsLeasesResourceLock:
    		return &MultiLock{
    			Primary:   configmapLock,
    			Secondary: leaseLock,
    		}, nil
    	default:
    		return nil, fmt.Errorf("invalid lock-type %s", lockType)
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 6K bytes
    - Viewed (0)
  5. pilot/pkg/leaderelection/k8sleaderelection/leaderelection_test.go

    				return true, nil, fmt.Errorf("unreachable action")
    			})
    
    			switch objectType {
    			case rl.EndpointsLeasesResourceLock:
    				lock = &rl.MultiLock{
    					Primary: &rl.EndpointsLock{
    						EndpointsMeta: objectMeta,
    						LockConfig:    resourceLockConfig,
    						Client:        c.CoreV1(),
    					},
    					Secondary: &rl.LeaseLock{
    						LeaseMeta:  objectMeta,
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jan 23 16:39:43 UTC 2023
    - 42.5K bytes
    - Viewed (0)
Back to top