• Kouhei Ueno's avatar
    Avoid data race in Proxier.OnUpdate · 2e02967a
    Kouhei Ueno authored
    The bug was that the proxier is passed as value on method decleration.
    This caused a copy of Proxier to be created when the method was invoked.
    The copy being a shallow copy turned out to have them both reference
    a same map instance, but their mutexes were different instances.
    This turned out to use different mutexes before operating on a same map
    instance, which didn't make sense.
    2e02967a
proxier.go 6.32 KB