Merge pull request #654 from openziti/remove-double-cleanup

listener.close already cleaned up interceptor. don't need to do it again
This commit is contained in:
Paul Lorenz
2021-04-30 13:06:24 -04:00
committed by GitHub
2 changed files with 2 additions and 8 deletions
+1 -2
View File
@@ -97,7 +97,7 @@ func (self *servicePoller) handleServiceListUpdate(lastUpdateToken []byte, servi
}
// TODO: just push updates down the control channel when necessary
func (self *servicePoller) pollServices(pollInterval time.Duration, notifyClose <-chan struct{}, closeHandler func()) {
func (self *servicePoller) pollServices(pollInterval time.Duration, notifyClose <-chan struct{}) {
if err := self.fabricProvider.authenticate(); err != nil {
logrus.WithError(err).Fatal("xgress_edge_tunnel unable to authenticate to controller. " +
"ensure tunneler mode is enabled for this router or disable tunnel listener. exiting ")
@@ -113,7 +113,6 @@ func (self *servicePoller) pollServices(pollInterval time.Duration, notifyClose
case <-ticker.C:
self.requestServiceListUpdate()
case <-notifyClose:
closeHandler()
return
}
}
+1 -6
View File
@@ -27,7 +27,6 @@ import (
"github.com/openziti/fabric/router/xgress"
cmap "github.com/orcaman/concurrent-map"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"net"
)
@@ -87,11 +86,7 @@ func (self *tunneler) Start(notifyClose <-chan struct{}) error {
self.servicePoller.serviceListener.HandleProviderReady(self.fabricProvider)
self.interceptor.Start(self.fabricProvider)
go self.servicePoller.pollServices(self.listenOptions.svcPollRate, notifyClose, func() {
logrus.Info("stopping xgress_edge_tunnel.interceptor")
self.interceptor.Stop()
logrus.Info("stopped xgress_edge_tunnel.interceptor")
})
go self.servicePoller.pollServices(self.listenOptions.svcPollRate, notifyClose)
return nil
}