Storage endpoint disconnected with large folder on Android

I have a folder on my Pixel 8 Pro that contains my photos and videos which at the moment consists of ~44,000 files totaling ~360 GB. In the last 6 months or so, I’ve found that syncthing is randomly crashing (the app will look like it is working, but the “Web GUI” page is “Webpage not available” with error net::ERR_CONECTION_REFUSED), which has eventually started to manifest as all the folders showing up as “storage endpoint not connected”. This is also causing problems for other apps that are reading from the internal SD card, which will randomly stop playing audio or otherwise fail when syncthing is active.

I think what is happening is that Syncthing tries to do a full rescan or something, and for whatever reason this is absolutely swamping all system calls to the file system or something of that nature, eventually leading the app to crash or the OS to consider the disk unavailable. This happened with the old Syncthing Android app and did not change when I switched to Syncthing-Fork.

I suspect that either what is happening is that system calls to super huge folders are just really resource-intensive or syncthing is trying to do way too many things in parallel. Does anyone have any tips for improving this or for managing these mega-huge directories in the first place?

This is a powerful device, on which Syncthing really shouldn’t experience any such crashes. Once the problem occurs and you no longer can access the Web GUI, please go to Android/data/com.nutomic.syncthingandroid/files on the internal storage, where you should find syncthing.log. Please upload the log file here. The app name in the path will be different if you’re using the Fork, but the log file should still be there.