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

Deleting a large quantity of files makes the UI unresponsive #11431

Closed
federicobozzini opened this issue Jul 15, 2022 · 10 comments · Fixed by #11975
Closed

Deleting a large quantity of files makes the UI unresponsive #11431

federicobozzini opened this issue Jul 15, 2022 · 10 comments · Fixed by #11975
Labels
filesystem issues related to the filesystem

Comments

@federicobozzini
Copy link
Contributor

Bug Description:

Steps to Reproduce:

  1. Add a large quantity of files and folders in the Theia workspace (>10GB)
  2. Delete the files all at once (from the UI, select all, open the context menu and click on the delete menu item)
  3. Interact with any other item left in the workspace (EG: expanding folder). Nothing happens

Depending on the nature of the files delete, an error notification might be shown in the UI:

Unable to watch for file changes in this large workspace. The information you see may not include recent file changes.

Sometimes an error is also thrown by NSFW here. The error is:
Service shutdown: root path changed (renamed or deleted)
This is probably misleading because the root path (the Theia workspace) has not been renamed or deleted.

Additional Information

  • Operating System: Ubuntu 20.04
  • Theia Version: 1.27
@msujew msujew added the filesystem issues related to the filesystem label Jul 15, 2022
@tsmaeder
Copy link
Contributor

tsmaeder commented Nov 8, 2022

I was not able to reproduce the problem on Windows; here's what I did:

  1. created a workspace with 10 copies of the theia node_modules folder for a total of > 10Gb.
  2. Expanded the node_modules folders and selected everything.
  3. Select "Delete" from the context menu
  4. Observe: the delete took around a minute, but proceeded without problems.

@tsmaeder
Copy link
Contributor

tsmaeder commented Nov 8, 2022

@AlexandraBuzila is your scenario different?

@AlexandraBuzila
Copy link
Contributor

Hi @tsmaeder,
I was able to reproduce the problem in Ubuntu, with the electron example.
My workspace also contained packages from the node_modules folder, as you described in your test steps, but I pasted them directly into the workspace directory. There were about 1200 roots.
If I interacted with the Explorer while the delete operation was running (e.g. expanding folders), sometimes an error popped up (Unable to watch for file changes in this large workspace. The information you see may not include recent file changes.) and the Explorer was not refreshing properly anymore.

@vince-fugnitto vince-fugnitto changed the title Deleting a large quantity of files makes the UI unrensposive Deleting a large quantity of files makes the UI unresponsive Nov 8, 2022
@tsmaeder
Copy link
Contributor

tsmaeder commented Nov 9, 2022

I ran into a problem where the delete would fail with an unrelated error

Error: ENOENT: no such file or directory, mkdir '/var/snap/firefox/common/host-hunspell./.Trash-1000'

probably due to this:

https://askubuntu.com/questions/1431815/lsblk-root-partition-mounted-on-and-var-snap-firefox-common-host-hunspell

@tsmaeder
Copy link
Contributor

tsmaeder commented Nov 10, 2022

I remove Firefox from my system and now I'm getting

Error: Service shutdown: root path changed (renamed or deleted)

after getting around 50 correct DELETED notifications. Debugging through the C++ code reveals that nsfw tries to remove the watched root directory when it should be removing the subdirectory that is being removed. Currently not sure why this is happening, but I can reproduce in a simple nodejs program, so the problem should be debuggable.

The gist here is this seems to be a nsfw problem. I'll be away for a week and pick this up again then.

@tsmaeder
Copy link
Contributor

The error case occurs when more than one "MOVED_FROM" event is in the buffer delivered to InotifyEventLoop#work(). The algorithm then decides that it's not a delete of a directory form the watched directory with handle 1, but a remove of the watched directory with handle 1. Investigating as to the cause.

@tsmaeder
Copy link
Contributor

Methinks I have a fix: Axosoft/nsfw#171. Now waiting for feedback from nsfw folks.

@marcdumais-work
Copy link
Contributor

@tsmaeder I see this error message with a significant portion of the CI failures we have in this repo [1]. It would be awesome if your fix helped.

[1]: e.g.: https://github.com/eclipse-theia/theia/actions/runs/3524336163/jobs/5909603214#step:7:4339

@tsmaeder
Copy link
Contributor

PR has been merged. Waiting for a new release of nsfw.

tsmaeder added a commit to tsmaeder/theia that referenced this issue Dec 9, 2022
Contributed on behalf of ST Microelectronics

Signed-off-by: Thomas Mäder <[email protected]>
@tsmaeder
Copy link
Contributor

tsmaeder commented Dec 9, 2022

We have a new release: https://github.com/Axosoft/nsfw/releases/tag/v2.2.4

paul-marechal pushed a commit that referenced this issue Jan 5, 2023
Fixes #11431.

Contributed on behalf of ST Microelectronics.

Signed-off-by: Thomas Mäder <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filesystem issues related to the filesystem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants