Canop / broot

A new way to see and navigate directory trees : https://dystroy.org/broot
MIT License
10.64k stars 234 forks source link

broot hangs on a large nested directory #807

Open sschuldenzucker opened 10 months ago

sschuldenzucker commented 10 months ago

When I open broot in my home directory (with a lot of nested stuff under it), at first it works fine but at some point it'll hang completely: I can't add/delete letters or quit or cancel; Ctrl+C doesn't work; need to kill using kill from another terminal.

This occurs consistently in my home directory (though it's probably hard to reproduce for someone else :/).

I think the hanging occurs after typing a few letters, where there are not so many matches in shallow levels below anymore and broot recurs deeper and deeper into the hierarchy trying to find more matches to show.

It seems unavoidable that this is slow, but the hangup shouldn't occur.

System Information

Canop commented 10 months ago

Such a freeze isn't "normal". I mean it's not just broot being slow to explore, but it probably means that a system call (eg read_dir or metadata) never ends. It's not really easy to handle. Maybe having a watcher thread kill broot when it happens would be the best solution.

As for finding what's the failing directory, I know by experience it's not easy, even if you add log statements before every system calls. Tree building being parallel doesn't help. Can you try launching BROOT_LOG=debug br -s ~, navigate without search, and see if you find the culprit, either directly in broot or in the generated broot.log file on freeze ?