Skip to content

Commit

Permalink
Revert "fix: goroutine leak during watch leases (kube)"
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrtbnfgl authored Sep 18, 2023
1 parent 210f54f commit db8aa90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/subnet/etcd/subnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ func TestRenewLease(t *testing.T) {
t.Fatal("RenewLease failed: ", err)
}
//we expect the new lease to have an expiration date in exactly 24h
acceptableMargin := 10 * time.Second
acceptableMargin := 5 * time.Second
expectedExpiration := time.Now().Add(subnetTTL).Round(time.Duration(acceptableMargin))

etcdResp, err := kvApi.Get(ctx, "/coreos.com/network/subnets", etcd.WithPrefix())
Expand Down
3 changes: 1 addition & 2 deletions pkg/subnet/kube/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,7 @@ func (ksm *kubeSubnetManager) WatchLeases(ctx context.Context, receiver chan []l
Events: []lease.Event{event},
}}
case <-ctx.Done():
close(receiver)
return ctx.Err()
return context.Canceled
}
}
}
Expand Down

0 comments on commit db8aa90

Please sign in to comment.