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

Fixes: 17292 - Detect infinite loop condition while iterating terminations in CablePath.from_origin #17293

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

bctiemann
Copy link
Contributor

Fixes: #17292

Compares each iteration through terminations in from_origin to the previous iteration. If the path elements added in the current iteration are the same as those that were added in the previous iteration, this is an infinite loop and we log the issue and break out of the loop.

@bctiemann bctiemann self-assigned this Aug 28, 2024
Copy link
Contributor

github-actions bot commented Oct 3, 2024

This PR has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further action is taken.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Oct 3, 2024
@DanSheps DanSheps removed the pending closure Requires immediate attention to avoid being closed for inactivity label Oct 3, 2024
Copy link
Contributor

github-actions bot commented Nov 3, 2024

This PR has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further action is taken.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Nov 3, 2024
Comment on lines +722 to +727
num_elements_added = len(path) - len(prev_path)
prev_elements_added = prev_path[-num_elements_added:]
elements_added = path[-num_elements_added:]
if elements_added == prev_elements_added:
logger.warning('Infinite loop detected while updating cable path trace')
break
Copy link
Member

Choose a reason for hiding this comment

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

If I am understanding this correctly, this iwll only detect a loop in the last element, not if it is 3 elements back

Eg:

FP1 <> RP1 <> RP2 <> FP2 <> FP3 <> RP3 <> RP4 <> FP4 <> FP1

Could youy confirm this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending closure Requires immediate attention to avoid being closed for inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detect infinite loop in cable paths
2 participants