Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move SelectionOptions and UseMultiplePath to server-local vars #2716

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dawn-minion
Copy link
Contributor

In destination.go there were two global variables used for controlling path and multi-path support for BGP servers, which were populated and modified by gRPC/public API calls. In scenarios where multiple BGP servers are running using the public API it would mean that the last server created would override the options for all running servers. It also lead to data races (Confirmed by using Go's data race detector) that could crash Go's runtime as the value would be overridden unexpectedly.

To resolve this, both options have been moved into the TableManager itself which takes a pointer option to both structs populated via the StartBgp API call. These are then passed to the internal methods as new function parameters, ensuring that every server has a unique copy of these structs.

All tests were updated to conform to the new API.

@dawn-minion
Copy link
Contributor Author

This one was quite a refactor - I moved everything as function parameters where originally it read the global vars. None of the public API signatures are changed, so I am hoping it's still acceptable. Let me know if anything should be changed, thanks!

In destination.go there were two global variables used for controlling
path and multi-path support for BGP servers, which were populated and
modified by gRPC/public API calls. In scenarios where multiple BGP
servers are running using the public API it would mean that the last
server created would override the options for all running servers. It
also lead to data races (Confirmed by using Go's data race detector)
that could crash Go's runtime as the value would be overridden
unexpectedly.

To resolve this, both options have been moved into the TableManager
itself which takes a pointer option to both structs populated via the
StartBgp API call. These are then passed to the internal methods as new
function parameters, ensuring that every server has a unique copy of
these structs.

All tests were updated to conform to the new API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant