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

Project manager scan should run in a thread to keep responsive UI #5953

Open
Biarity opened this issue Jul 29, 2016 · 11 comments · May be fixed by #91064
Open

Project manager scan should run in a thread to keep responsive UI #5953

Biarity opened this issue Jul 29, 2016 · 11 comments · May be fixed by #91064

Comments

@Biarity
Copy link

Biarity commented Jul 29, 2016

Operating system or device - Godot version:
Windows 10, Godot 2.1rc1

Issue description (what happened, and what was expected):
Using the scan function at the project manager crashes Godot when I click 'open'.

Steps to reproduce:
Open Godot, click Scan, select a large folder, click Open. Shows the Windows Close/Debug error box.

@vnen
Copy link
Member

vnen commented Jul 29, 2016

I cannot reproduce this. The project manager stops responding while it is searching for files but if I leave it running it manages to fill the list.

Maybe moving the search to a separate thread might be good so the editor keeps responsive while searching.

@Biarity
Copy link
Author

Biarity commented Jul 29, 2016

Try one of the folders in C:\Users on Windows. Other folders on my Desktop seem to work fine.

@vnen
Copy link
Member

vnen commented Jul 29, 2016

For me it just hangs for a long time scanning the folders. On the Downloads folder (which has just a few subfolders) it finishes pretty much instantly.

@akien-mga akien-mga added this to the 2.2 milestone Jul 29, 2016
@bojidar-bg
Copy link
Contributor

Any chance this is related to stack overflows?

@vnen
Copy link
Member

vnen commented Jul 29, 2016

AFAIK it does not "crash" it just stops responding. If you click on the window then Windows will show the problem and asks if you want to force close it, which can be mistaken by a crash.

I still think it's just a matter of moving the scan to a new thread to show some progress and keep the editor responsive.

@akien-mga akien-mga removed this from the 2.2 milestone Aug 8, 2017
@akien-mga akien-mga changed the title Godot project manager crashes when using 'Scan' Project manager scan should run in a thread to keep responsive UI Aug 8, 2017
@akien-mga
Copy link
Member

I still think it's just a matter of moving the scan to a new thread to show some progress and keep the editor responsive.

Edited issue title accordingly.

@Calinou
Copy link
Member

Calinou commented Dec 7, 2019

Note that while #30735 helps with project loading speed, it doesn't implement non-blocking scanning.

If we want a simple solution to this, we can dim the window while projects are being scanned (like when quitting the editor or project manager). This will at least provide some kind of visual feedback without complexifying the code too much. We could also abort scanning if it takes more than 5 seconds or so.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 12, 2020

This doesn't need to run in thread actually. We could just utilize NOTIFICATION_PROCESS and e.g. scan 100 directories each frame. Easy to do and even allows cancelling, so it's more UX problem.

@Zylann
Copy link
Contributor

Zylann commented May 17, 2021

If this is done in process, then it should be staggered (i.e keep scanning until 10 ms elapsed then continue next frame) because filesystem access can vary wildly across computers, hardware and OSes. On the other hand, with sliiightly more work, using a thread may actually be a more efficient approach while keeping UI perfectly responsive, and it can be cancelled even just with a boolean.
I did the staggered approach for Find in Files as well but I'd like to change it to a thread one day for larger projects.

@Calinou Calinou added enhancement and removed bug labels Jun 15, 2021
@akien-mga
Copy link
Member

Still valid as of 4.0 for the record. This is only a problem on huge folders, even a somewhat big tree of projects like https://github.com/godotengine/godot-demo-projects is scanned in milliseconds.

@kingthrillgore
Copy link

I see a similar behavior when I attempt to open a large project on a separate in-system HDD (its own disk letter) on Windows 10 with 4.1.2. I don't see a lot of logging data to help narrow this down, and after force closing I can reopen it and it will load the second time. It's a big project though, and if the developers would like to access the repo to aid in testing, I can make it available to them.

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.

8 participants