You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
c. go manager.Run() spins up a goroutine where the closure from 2b is called periodically
The result is that the exact same rebalancer closure for a given dc is being run in separate goroutines. If they overlap, r.clientConn.UpdateState is called in quick succession, resulting in the infamous WARN (related to #10603)
On agent startup it is likelier that these WARNS will be emitted since the goroutines kick off at nearly the same time. Over time, the jitter in the rebalancer will cause the timings to drift apart but does not eliminate the chance to overlap.
The text was updated successfully, but these errors were encountered:
Unsure what a clean solution would be in this case; does the manager need to be aware of the grpc server shuffling? If we can rip it out of the manager and do it at a higher level that isn't scoped to an AreaID that would be great.
kisunji
changed the title
Unnecessary gRPC rebalancing leads to WARN logs on startup
Unnecessary gRPC rebalancing leads to occasional WARN logs
Feb 21, 2023
While investigating #10603 I think I spotted a small bug in our router spinning up an unnecessary grpc rebalancer:
Router
has a singlegrpcServerTracker
consul/agent/router/router.go
Lines 45 to 47 in e20e634
Router
will callAddArea
withLAN
andWAN
separatelyconsul/agent/consul/server.go
Lines 661 to 672 in bafa5c7
a. Each
AddArea
call will eventually callmaybeInitializeManager
consul/agent/router/router.go
Line 159 in e20e634
consul/agent/router/router.go
Line 178 in e20e634
consul/agent/router/router.go
Lines 278 to 282 in e20e634
b.
maybeInitializeManager
will fetch a rebalancer closure fromgrpcServerTracker
for a given dcconsul/agent/router/router.go
Lines 256 to 264 in e20e634
c.
go manager.Run()
spins up a goroutine where the closure from 2b is called periodicallyThe result is that the exact same rebalancer closure for a given dc is being run in separate goroutines. If they overlap,
r.clientConn.UpdateState
is called in quick succession, resulting in the infamous WARN (related to #10603)On agent startup it is likelier that these WARNS will be emitted since the goroutines kick off at nearly the same time. Over time, the jitter in the rebalancer will cause the timings to drift apart but does not eliminate the chance to overlap.
The text was updated successfully, but these errors were encountered: