mirror of
https://github.com/openziti/ziti.git
synced 2026-10-12 23:32:02 +00:00
Merge pull request openziti/fabric#297 from openziti/verify-link-before-ctrl-ch
Ensure we don't return a nil control channel while starting up
This commit is contained in:
@@ -90,6 +90,12 @@ func (self *Router) MetricsRegistry() metrics.UsageRegistry {
|
||||
}
|
||||
|
||||
func (self *Router) Channel() channel2.Channel {
|
||||
// if we're just starting up, we may be nil. wait till initialized
|
||||
// The initial control channel connect has a timeout, so if that timeouts the process will exit
|
||||
// Once connected the control channel will never get set back to nil. Reconnects happen under the hood
|
||||
for self.ctrl == nil {
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
}
|
||||
return self.ctrl
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ func Test_Ordering(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
|
||||
timeout := time.After(10 * time.Second)
|
||||
timeout := time.After(20 * time.Second)
|
||||
|
||||
req := require.New(t)
|
||||
for i := 0; i < msgCount; i++ {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
//go:build apitests
|
||||
|
||||
package tests
|
||||
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user