Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 659 for defer (0.17 sec)

  1. cmd/erasure-server-pool-rebalance.go

    	z.rebalMu.Lock()
    	defer z.rebalMu.Unlock()
    
    	r := z.rebalMeta
    	if r == nil {
    		return
    	}
    
    	r.PoolStats[poolIdx].update(bucket, fi)
    }
    
    const (
    	rebalMetaName = "rebalance.bin"
    	rebalMetaFmt  = 1
    	rebalMetaVer  = 1
    )
    
    func (z *erasureServerPools) nextRebalBucket(poolIdx int) (string, bool) {
    	z.rebalMu.RLock()
    	defer z.rebalMu.RUnlock()
    
    	r := z.rebalMeta
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 26 19:29:28 GMT 2024
    - 27.2K bytes
    - Viewed (0)
  2. cni/pkg/nodeagent/pod_cache.go

    func (p *podNetnsCache) Get(uid string) Netns {
    	// lock current snapshot pod map
    	p.mu.RLock()
    	defer p.mu.RUnlock()
    	if info, f := p.currentPodCache[uid]; f {
    		return info.Netns
    	}
    	return nil
    }
    
    // make sure uid is in the cache, even if we don't have a netns
    func (p *podNetnsCache) Ensure(uid string) {
    	p.mu.Lock()
    	defer p.mu.Unlock()
    	if _, ok := p.currentPodCache[uid]; !ok {
    		p.currentPodCache[uid] = WorkloadInfo{}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 4.5K bytes
    - Viewed (0)
  3. cmd/etcd.go

    	timeoutCtx, cancel := context.WithTimeout(ctx, defaultContextTimeout)
    	defer cancel()
    
    	_, err := client.Delete(timeoutCtx, key)
    	etcdLogIf(ctx, err)
    	return etcdErrToErr(err, client.Endpoints())
    }
    
    func readKeyEtcd(ctx context.Context, client *etcd.Client, key string) ([]byte, error) {
    	timeoutCtx, cancel := context.WithTimeout(ctx, defaultContextTimeout)
    	defer cancel()
    	resp, err := client.Get(timeoutCtx, key)
    	if err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  4. cni/pkg/nodeagent/netns_linux.go

    		threadNS, err := netns.GetCurrentNS()
    		if err != nil {
    			return fmt.Errorf("failed to open current netns: %v", err)
    		}
    		defer threadNS.Close()
    
    		// switch to target namespace
    		if err = NetnsSet(fdable); err != nil {
    			return err
    		}
    		defer func() {
    			err := threadNS.Set() // switch back
    			if err == nil {
    				// Unlock the current thread only when we successfully switched back
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Wed Jan 31 10:05:36 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  5. internal/logger/reqinfo.go

    	if r == nil {
    		return nil
    	}
    	r.Lock()
    	defer r.Unlock()
    	r.tags = append(r.tags, KeyVal{key, val})
    	return r
    }
    
    // SetTags - sets key/val to ReqInfo.tags
    func (r *ReqInfo) SetTags(key string, val interface{}) *ReqInfo {
    	if r == nil {
    		return nil
    	}
    	r.Lock()
    	defer r.Unlock()
    	// Search of tag key already exists in tags
    	var updated bool
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  6. cmd/tier-journal.go

    		return // No read-only journal to process; nothing to do.
    	case err != nil:
    		logger.LogIf(ctx, fmt.Errorf("tier-journal: failed open read-only journal for processing %s", err))
    		return
    	}
    	defer ro.Close()
    	mr := msgpNewReader(ro)
    	defer readMsgpReaderPoolPut(mr)
    
    	done := false
    	for {
    		var entry jentry
    		err := entry.DecodeMsg(mr)
    		if errors.Is(err, io.EOF) {
    			done = true
    			break
    		}
    Go
    - Registered: Sun Feb 25 19:28:16 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  7. cmd/erasure-multipart.go

    		pool := globalBytePoolCap.Load()
    		bufA := pool.Get()
    		bufB := pool.Get()
    		defer pool.Put(bufA)
    		defer pool.Put(bufB)
    		ra, err := readahead.NewReaderBuffer(data, [][]byte{bufA[:fi.Erasure.BlockSize], bufB[:fi.Erasure.BlockSize]})
    		if err == nil {
    			toEncode = ra
    			defer ra.Close()
    		}
    	}
    
    	n, err := erasure.Encode(pctx, toEncode, writers, buffer, writeQuorum)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 43K bytes
    - Viewed (0)
  8. cmd/ftp-server-driver.go

    	stopFn := globalFtpMetrics.log(ctx, objPath)
    	defer stopFn(err)
    
    	clnt, err := driver.getMinIOClient(ctx)
    	if err != nil {
    		return err
    	}
    
    	cctx, cancel := context.WithCancel(context.Background())
    	defer cancel()
    
    	bucket, prefix := path2BucketObject(objPath)
    	if bucket == "" {
    		buckets, err := clnt.ListBuckets(cctx)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 19 12:23:42 GMT 2024
    - 13.6K bytes
    - Viewed (0)
  9. cmd/untar.go

    		if err != nil {
    			return err
    		}
    		defer gz.Close()
    		r = gz
    	case formatS2:
    		r = s2.NewReader(bf)
    	case formatZstd:
    		// Limit to 16 MiB per stream.
    		dec, err := zstd.NewReader(bf, zstd.WithDecoderMaxWindow(16<<20))
    		if err != nil {
    			return err
    		}
    		defer dec.Close()
    		r = dec
    	case formatBZ2:
    		ctx, cancel := context.WithCancel(ctx)
    		defer cancel()
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 6K bytes
    - Viewed (0)
  10. cni/pkg/nodeagent/ztunnelserver_test.go

    func TestZtunnelSendsPodSnapshot(t *testing.T) {
    	ztunnelKeepAliveCheckInterval = time.Second / 10
    	mt := monitortest.New(t)
    	setupLogging()
    	ctx, cancel := context.WithCancel(context.Background())
    	defer cancel()
    
    	fixture := connect(ctx)
    	ztunClient := fixture.ztunClient
    	uid := fixture.uid
    
    	m, fds := readRequest(t, ztunClient)
    	// we got am essage from ztun, so it should have observed us being connected
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 8.6K bytes
    - Viewed (0)
Back to top