Bug 1753216: Clean up egress IPs on startup #51
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a node lost an egress IP while the sdn process was being restarted, the sdn wouldn't remove the stale egress IP from the node's interface, so you'd end up with two nodes fighting over the packets.
This fixes that by (1) labeling the egress IPs we add so that we can recognize them later, and (2) running a cleanup after we've finished syncing with the master on startup.
(Also,
node.egressIPWatcherhad a mutex that it wasn't using... but it turns out that this isn't a problem because its methods are only called fromcommon.EgressIPTracker, which does use a mutex when calling the watcher methods. I probably meant to delete the mutex when I split out thecommonparts of the egress IP code, but forgot.)