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
To my knowledge, the n.localNode reference is not stored by any consumer at the moment, so I don't think the race can happen in practise at the moment. This is because the lock is held during the call to n.Manager.NodeUpdated(n.localNode) where all the data access happens via getters happens.
But regardless, we should still fix this, for example by creating a copy of the local node object, to ensure that any future consumers will not introduce a data race by accident.
The text was updated successfully, but these errors were encountered:
As pointed out by Louis, there is a potential data race with the
NodeDiscovery
module. It protects local node updates via the following mutex:cilium/pkg/nodediscovery/nodediscovery.go
Lines 650 to 658 in 47e936e
But the getters of the
localNode
object are not aware of the lock, and therefore could concurrently read the fields while they are getting updated.cilium/pkg/node/types/node.go
Lines 439 to 448 in b4b7500
To my knowledge, the
n.localNode
reference is not stored by any consumer at the moment, so I don't think the race can happen in practise at the moment. This is because the lock is held during the call ton.Manager.NodeUpdated(n.localNode)
where all the data access happens via getters happens.But regardless, we should still fix this, for example by creating a copy of the local node object, to ensure that any future consumers will not introduce a data race by accident.
The text was updated successfully, but these errors were encountered: