E57D Time.tickers that are no longer in use should be closed (#34200) · libesz/istio@e8ccf87 · GitHub
[go: up one dir, main page]

Skip to content

Commit e8ccf87

Browse files
istio-testingChenglongGao327
authored andcommitted
Time.tickers that are no longer in use should be closed (istio#34200)
1. if time.ticker no longer in use ,stop it Co-authored-by: Chenglong Gao <gaochenglong@huawei.com>
1 parent 96853e3 commit e8ccf87

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

pkg/istio-agent/health/health_check.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ func (w *WorkloadHealthChecker) PerformApplicationHealthCheck(callback func(*Pro
170170
// Send the first request immediately
171171
doCheck()
172172
periodTicker := time.NewTicker(w.config.CheckFrequency)
173+
defer periodTicker.Stop()
173174
for {
174175
select {
175176
case <-quit:

security/pkg/pki/ca/ca.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ func NewSelfSignedIstioCAOptions(ctx context.Context,
101101
if scrtErr != nil && readCertRetryInterval > time.Duration(0) {
102102
pkiCaLog.Infof("Citadel in signing key/cert read only mode. Wait until secret %s:%s can be loaded...", namespace, CASecret)
103103
ticker := time.NewTicker(readCertRetryInterval)
104+
defer ticker.Stop()
104105
for scrtErr != nil {
105106
select {
106107
case <-ticker.C:

0 commit comments

Comments
 (0)
0