Skip to content

Commit

Permalink
Merge pull request #1443 from openziti/shudown-network-watchdog
Browse files Browse the repository at this point in the history
Shutdown network watchdog when controller stops. Fixes #1442
  • Loading branch information
plorenz authored Oct 16, 2023
2 parents c5a51df + 47a00aa commit 15e1e93
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions controller/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"compress/gzip"
"encoding/json"
"fmt"
"github.com/openziti/foundation/v2/goroutines"
fabricMetrics "github.com/openziti/ziti/common/metrics"
"github.com/openziti/ziti/controller/event"
"github.com/openziti/foundation/v2/goroutines"
"os"
"path/filepath"
"runtime/debug"
Expand All @@ -32,24 +32,24 @@ import (
"sync"
"time"

"github.com/openziti/ziti/controller/command"
"github.com/openziti/foundation/v2/versions"
"github.com/openziti/ziti/controller/command"

"github.com/michaelquigley/pfxlog"
"github.com/openziti/channel/v2/protobufs"
"github.com/openziti/ziti/common/ctrl_msg"
"github.com/openziti/ziti/common/logcontext"
"github.com/openziti/ziti/common/pb/ctrl_pb"
"github.com/openziti/ziti/common/trace"
"github.com/openziti/ziti/controller/db"
"github.com/openziti/ziti/controller/xt"
"github.com/openziti/foundation/v2/debugz"
"github.com/openziti/foundation/v2/errorz"
"github.com/openziti/foundation/v2/sequence"
"github.com/openziti/identity"
"github.com/openziti/metrics"
"github.com/openziti/metrics/metrics_pb"
"github.com/openziti/storage/boltz"
"github.com/openziti/ziti/common/ctrl_msg"
"github.com/openziti/ziti/common/logcontext"
"github.com/openziti/ziti/common/pb/ctrl_pb"
"github.com/openziti/ziti/common/trace"
"github.com/openziti/ziti/controller/db"
"github.com/openziti/ziti/controller/xt"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"go.etcd.io/bbolt"
Expand Down Expand Up @@ -909,6 +909,8 @@ func (network *Network) watchdog() {
case <-network.watchdogCh:
consecutiveFails = 0
continue
case <-network.closeNotify:
return
default:
consecutiveFails++
// network.Run didn't complete, something is stalling it
Expand Down

0 comments on commit 15e1e93

Please sign in to comment.