A bunch of weeks ago I noticed Spotify was using a big chunk of the cpu time (between 50% and 100%).
First I think it was a know bug but after a quick search I've found no one was reporting this so I decided to take a deeper look into it.
I've used strace to detect what was happening and seems like when some of the "Local Files > Show songs from" is enabled it recursively search over the current user directory without a depth or parameter to stop.
Looking in the strace output I figured out there was circular referenced symlynks inside a project I been working on that was causing this:
getdirentries64(0x42, 0x7FD55642A800, 0x1000) = 1360 0
stat64("/Users/SomeUser/Downloads/test/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cr/gt/dm/cl/gt/cr/gt/cr/cl/dm/.csslintrc\0", 0x70000B751A80, 0x1000) = 0 0
stat64("/Users/SomeUser/Downloads/test/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cr/gt/dm/cl/gt/cr/gt/cr/cl/dm/.DS_Store\0", 0x70000B751A80, 0x1000) = 0 0
stat64("/Users/SomeUser/Downloads/test/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cl/cr/gt/dm/cl/gt/cr/gt/cr/cl/dm/.editorconfig\0", 0x70000B751A80, 0x1000) = 0 0 Acceptance criteria
- Symlinks should be crawled as before
- Provide a mechanism to stop crawling directories when a circular reference is detected