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

Possible infinite loop in cable tracing algorithm #185

Closed
glennmatthews opened this issue Mar 23, 2021 · 1 comment · Fixed by #202
Closed

Possible infinite loop in cable tracing algorithm #185

glennmatthews opened this issue Mar 23, 2021 · 1 comment · Fixed by #202
Assignees
Labels
type: bug Something isn't working as expected
Milestone

Comments

@glennmatthews
Copy link
Contributor

glennmatthews commented Mar 23, 2021

Environment

  • Python version: 3.7
  • Nautobot version: develop @ d604c75

Steps to Reproduce

  1. Create a circuit and add A and Z terminations
  2. In the detail view for this circuit, select "Connect -> Circuit Termination" for either termination, and select the other termination of this same circuit as the other end of the cable.
  3. The browser spins indefinitely waiting for a response from Nautobot.

image

Expected Behavior

Either constructing such a loop should be forbidden outright (similar to how Nautobot rejects an attempt to cable a device's rear port to its own front port that maps to that rear port) or the loop should be detected and handled gracefully.

Observed Behavior

The cable never gets constructed, but no error message is reported either.

@dgjustice
Copy link
Contributor

It looks like node can be assigned back to itself, and there is no visited nodes structure, hence the loop will never terminate. I'm going to write some tests to break this, then work back from that.

node = peer_termination.get_peer_termination()

Release v1.0.0 automation moved this from To do to Done Mar 26, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants