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

Fix restoreInitialTopology in SA with multiple SCs #1003

Merged
merged 8 commits into from
Mar 29, 2024

Conversation

caioluke
Copy link
Member

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

When restoring the initial topology in SA, we try to close switches/branches in all LfNetworks. When we have more than 1 LfNetwork, the code crashes.

What is the new behavior (if this is a feature change)?
We will be able to restore the initial topology in SA with multiple SCs.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

Signed-off-by: Caio Luke <caioluke97@gmail.com>
@caioluke caioluke requested a review from obrix March 25, 2024 15:54
@caioluke caioluke self-assigned this Mar 25, 2024
@annetill
Copy link
Member

Aïe... thanks

@obrix
Copy link
Member

obrix commented Mar 27, 2024

The missing coverage are edge cases very hard to test in a unit test. I feel we can merge as is.

restoreInitialTopology(lfNetwork, modifiedTopoConfig.getSwitchesToClose(), modifiedTopoConfig.getBranchIdsToClose());
restoreInitialTopology(lfNetwork, switchAndBranchIdsLeftToClose);
}
if (!switchAndBranchIdsLeftToClose.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we could be in that case (with the exception). If we are in that case, it means that we have a bug in the code. Any advice @geofjamg ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either:

  • we are able to add a test case for this case because it is a real case
  • we remove the code because it cannot happen

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a real case, I just put it to be sure that we would catch a bug if it happened. I will remove this bit of code.

Copy link

sonarcloud bot commented Mar 28, 2024

@annetill annetill changed the title Bugfix for restoreInitialTopology in SA with multiple SCs Fix restoreInitialTopology in SA with multiple SCs Mar 28, 2024
@annetill annetill added the bug Something isn't working label Mar 28, 2024
@annetill annetill merged commit 08c2a4d into main Mar 29, 2024
6 checks passed
@annetill annetill deleted the fix_restore_initial_topology_multiple_scs branch March 29, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR: next-release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants