mirror of
https://github.com/rclone/rclone.git
synced 2026-01-07 02:54:04 +00:00
Before this change when doing a sync with `--no-traverse` and `--files-from` we could call `NewObject` a total of `--checkers` * `--checkers` times simultaneously. With `--checkers 128` this can exceed the 10,000 thread limit and fails when run on a local to local transfer because `NewObject` calls `lstat` which is a syscall which needs an OS thread of its own. This patch uses a weighted semaphore to limit the number of simultaneous calls to `NewObject` to `--checkers` instead which won't blow the 10,000 thread limit and is far more sensible use of OS resources. Fixes #9073