Why is this an issue?
In internal/core/services/anycast_manager.go:96-101, the check-then-bind pattern is not atomic:
if !m.vipBound.Load() {
if err := m.vipManager.Bind(ctx, m.vip, m.iface); err != nil {
...
}
m.vipBound.Store(true)
}
Two concurrent announce() calls could both see vipBound == false and attempt to bind simultaneously.
How can it be solved?
Use atomic CompareAndSwap or a mutex to make the check-then-bind atomic.
Category
Severity
Why is this an issue?
In
internal/core/services/anycast_manager.go:96-101, the check-then-bind pattern is not atomic:Two concurrent
announce()calls could both seevipBound == falseand attempt to bind simultaneously.How can it be solved?
Use atomic CompareAndSwap or a mutex to make the check-then-bind atomic.
Category
Severity