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

Infinite loop in some search cases #5615

Closed
7 tasks
akhenry opened this issue Aug 4, 2022 · 7 comments · Fixed by #5619
Closed
7 tasks

Infinite loop in some search cases #5615

akhenry opened this issue Aug 4, 2022 · 7 comments · Fixed by #5619

Comments

@akhenry
Copy link
Contributor

akhenry commented Aug 4, 2022

Summary

Typing certain text into the search box can result in infinite requests in the network tab.
Looks like it's something to do with getOriginalPath. Suspect there is a circular reference somewhere.

Steps to Reproduce

  1. Search for "orphan"
  2. Observe that the search activity indicator appears and never disappears.
  3. Observe that no results are shown
  4. Open the network tab and observe that requests are firing off endlessly.

Environment

  • Open MCT Version: 2.0.7
  • Deployment Type: testathon

Impact Check List

  • Data loss or misrepresented data?
  • Regression? Did this used to work or has it always been broken?
  • Is there a workaround available?
  • Does this impact a critical component?
  • Is this just a visual bug with no functional impact?
  • Does this block the execution of e2e tests?
  • Does this have an impact on Performance?

Additional Information

@akhenry akhenry self-assigned this Aug 4, 2022
@akhenry
Copy link
Contributor Author

akhenry commented Aug 4, 2022

Critical because it leaves the application in a not so great state

@scottbell
Copy link
Contributor

scottbell commented Aug 5, 2022

How do you create a circular reference? Links would be one way, but we're not indexing them.

I've created a folder whose parent is itself. I'll use that as a test case for the interim as it appears to cause an infinite loop in search.

@scottbell scottbell linked a pull request Aug 5, 2022 that will close this issue
15 tasks
@scottbell
Copy link
Contributor

@akhenry would something like this work?
https://github.com/nasa/openmct/pull/5619/files

We basically just check to see if we've walked this parent before to avoid cycles.

It seems to work when a folder has itself for a parent, and when a folder has a child as its parent, e.g. Sub Folder A was manually changed to have Sub Folder C as its parent, though its composition lists its parent as First Folder :
image

The disadvantage of this is that per the originalPath, Sub Folder A is no longer reachable (no link to root), and thus won't appear in search results.

@akhenry
Copy link
Contributor Author

akhenry commented Aug 5, 2022

@scottbell Did some more investigation and found the culprit. I think the issue is in the MoveAction. It allows an object to be moved to its own child.

I like your proposed approach, and I will file a separate issue to fix the move and link actions to prevent circular references from being created.

@akhenry
Copy link
Contributor Author

akhenry commented Aug 5, 2022

Created #5620 to address the issue in the actions themselves.

@unlikelyzero
Copy link
Collaborator

@ozyx to test

@ozyx
Copy link
Member

ozyx commented Aug 22, 2022

Verified 8/22/22 Testathon:

Using CouchDB locally, created a folder whose parent was itself. Searched for the folder name and it showed up correctly in the search results without infinite search loop or unending network requests.

Only other issue was a duplicate entry, documented here: #5690

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants