"Too Many Open Files" from Mac SMB Server Share

How can I prevent opening too many files on a remotely mounted SMB share so that I can transfer its contents to Box?

I’ve mounted an SMB share from Mac OS X Server (macOS 10.11.6, Server 5.2) on a Mac 10.13.6 laptop, and I want to sync the SMB share to Box so that I can retire the server. It worked without any issues during testing, but mounting a remote file share with 280GB of files and then syncing results in “too many files open” errors and crashes the file server (disconnecting me in the process). I’m using:

rclone sync “/Volumes/SMB-SHARE” remote:“Transfer” --update --max-backlog 10 --exclude .DS_Store

Are there other flags that I should I try using so that I do not kill the server again? I tried lowering --max-backlog to 10 (default is 10000) but the same thing happened.

Rclone should only open about --transfers files at once so this is probably a bug.

Can you run lsof -c rclone to see the list of open files while it is running.

Are there about 4, or does the number creep up - if so then there is a file descriptor leak in rclone.

If it looks like there is a leak can you killall -QUIT rclone and post the resulting backtrace?