Cilium: Remove time.After usages

Created on 30 Nov 2020  ยท  3Comments  ยท  Source: cilium/cilium

from @christarazi :

โฏ rg "<-time.After(.+)" --glob '!vendor' --glob '!*_test.go'
operator/kvstore_watchdog.go
88:                     <-time.After(defaults.LockLeaseTTL)
100:                    <-time.After(kvstore.HeartbeatWriteInterval)
operator/identity_gc.go
46:                     <-time.After(operatorOption.Config.IdentityGCInterval)
clustermesh-apiserver/main.go
543:                    <-time.After(kvstore.HeartbeatWriteInterval)
pkg/contexthelpers/context.go
37:             case <-time.After(timeout):
pkg/kvstore/etcd.go
759:            case <-time.After(initialConnectionTimeout):
1171:           case <-time.After(e.extraOptions.StatusCheckInterval(allConnected)):
pkg/hubble/relay/observer/observer.go
103:                    case t := <-time.After(bufferDrainTimeout):
pkg/hubble/relay/pool/manager.go
95:                     case <-time.After(m.opts.retryTimeout):
110:                    case <-time.After(m.opts.retryTimeout):
133:                            case <-time.After(m.opts.retryTimeout):
166:            case <-time.After(m.opts.connCheckInterval):
pkg/kvstore/consul.go
394:            case <-time.After(sleepTime):
pkg/k8s/watchers/watcher.go
327:            case <-time.After(option.Config.K8sSyncTimeout):
pkg/backoff/backoff.go
105:    case <-time.After(t):
pkg/kvstore/lock.go
107:            case <-time.After(time.Duration(10) * time.Millisecond):
pkg/kvstore/store/store.go
492:    case <-time.After(listTimeoutDefault):
pkg/trigger/trigger.go
216:            case <-time.After(t.params.sleepInterval):
pkg/node/manager/manager.go
308:            case <-time.After(syncInterval):
pkg/node/store/store.go
176:    case <-time.After(defaults.NodeInitTimeout / 10):
pkg/controller/controller.go
283:            case <-time.After(interval):
pkg/maps/ctmap/gc/gc.go
136:                    case <-time.After(ctmap.GetInterval(mapType, maxDeleteRatio)):
147:    case <-time.After(30 * time.Second):
proxylib/test/accesslog_server.go
65:             case <-time.After(10 * time.Millisecond):
pkg/status/status.go
156:                    case <-time.After(interval):
pkg/allocator/allocator.go
314:                    case <-time.After(listTimeout):
853:                    case <-time.After(option.Config.KVstorePeriodicSync):
pkg/rate/api_limiter.go
733:            case <-time.After(limitWaitDuration):
daemon/cmd/hubble.go
191:                            case <-time.After(30 * time.Second):
good-first-issue help-wanted kinbug needs-backpor1.9

Most helpful comment

Context for the motivation: https://medium.com/@oboturov/golang-time-after-is-not-garbage-collected-4cbc94740082

However, seems to me that this is only an issue for long-running time.After invocations (i.e. in the order of minutes) and usages within a loop. So not all uses should necessary be replaced.

All 3 comments

Context for the motivation: https://medium.com/@oboturov/golang-time-after-is-not-garbage-collected-4cbc94740082

However, seems to me that this is only an issue for long-running time.After invocations (i.e. in the order of minutes) and usages within a loop. So not all uses should necessary be replaced.

Context for the motivation: https://medium.com/@oboturov/golang-time-after-is-not-garbage-collected-4cbc94740082

However, seems to me that this is only an issue for long-running time.After invocations (i.e. in the order of minutes) and usages within a loop. So not all uses should necessary be replaced.

+1

This was reverted by #14371

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianvernon picture ianvernon  ยท  4Comments

christarazi picture christarazi  ยท  4Comments

aledbf picture aledbf  ยท  4Comments

danwent picture danwent  ยท  4Comments

arzarif picture arzarif  ยท  4Comments