Skip to content

Commit

Permalink
fix ticker without stop (istio#45090)
Browse files Browse the repository at this point in the history
  • Loading branch information
rokkiter authored May 25, 2023
1 parent 03c4854 commit a23f50e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions istioctl/cmd/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func waitCmd() *cobra.Command {
printVerbosef(cmd, "tick")
continue
case err = <-w.errorChan:
t.Stop()
return fmt.Errorf("unable to retrieve Kubernetes resource2 %s: %v", "", err)
case <-ctx.Done():
printVerbosef(cmd, "timeout")
Expand Down
1 change: 1 addition & 0 deletions pilot/pkg/model/jwks_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ func TestJwtPubKeyEvictionForNotRefreshed(t *testing.T) {
for {
select {
case <-done:
c.Stop()
return
case <-c.C:
_, _ = r.GetPublicKey(mockCertURL, "")
Expand Down
1 change: 1 addition & 0 deletions pkg/envoy/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func (a *Agent) terminate() {
time.Sleep(a.minDrainDuration)
log.Infof("Checking for active connections...")
ticker := time.NewTicker(activeConnectionCheckDelay)
defer ticker.Stop()
for range ticker.C {
ac, err := a.activeProxyConnections()
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/test/echo/server/forwarder/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func doForward(ctx context.Context, cfg *Config, e *executor, doReq func(context
sleepTime := time.Second / time.Duration(qps)
fwLog.Debugf("Sleeping %v between requests", sleepTime)
throttle = time.NewTicker(sleepTime)
defer throttle.Stop()
}

g := e.NewGroup()
Expand Down

0 comments on commit a23f50e

Please sign in to comment.