Skip to content

rclone panic with runtime: program exceeds 10000-thread limit #9073

Closed

Description

@microyahoo

The associated forum post URL from https://forum.rclone.org

What is the problem you are having with rclone?

2025/12/30 21:50:03 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
2025/12/30 21:51:03 INFO  :
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Checks:                 0 / 0, -, Listed 293705
Elapsed time:       1m0.0s

runtime: program exceeds 10000-thread limit
fatal error: thread exhaustion

What is your rclone version (output from rclone version)

rclone v1.72.1
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.4.0-125-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.25.5
- go/linking: static
- go/tags: none

Which OS you are using and how many bits (e.g. Windows 7, 64 bit)

NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Which cloud storage system are you using? (e.g. Google Drive)

The command you were trying to run (e.g. rclone copy /tmp remote:tmp)

rclone copy /mnt/csi-data-aly/shared/public/routing/sd_map_shenzhen_and_chongqing/ /mnt/yrfs/public-data/training/rasmap/routing/sd_map_shenzhen_and_chongqing/ --checkers 128 --transfers 128 --local-no-set-modtime --size-only --log-level INFO --log-file /tmp/rclone_copy_1767100667_2_worker1_sd_map_shenzhen_and_chongqing_0032.index.log --no-traverse --files-from /mnt/yrfs/public-data/user/zhengliang/1767100667/cpu02.training.cpu.sgpai-3184568/2/sd_map_shenzhen_and_chongqing_0032.index

A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)

rclone_copy_1767100667_2_worker1_sd_map_shenzhen_and_chongqing_0032.ZKG0bsBz.index.log.txt

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Activity

  1. changed the title [-]rclone panic with runtime: program exceeds 10000-thread limit[/-] [+]rclone panic with `runtime: program exceeds 10000-thread limit`[/+] on Dec 30, 2025
  2. animosity022 commented on Dec 31, 2025

    @animosity022
    Contributor

    I think you are cranking up the defaults a whee bit high with 128 checkers and 128 transfers so you are hitting a ulimit making it panic. Generally making it that high will make things worse too as more is not always better.

    Try with defaults and adjust up.

  3. added a commit that references this issue on Dec 31, 2025
    8bcb1bd
  4. ncw commented on Dec 31, 2025

    @ncw
    Member

    Thank you for the log @microyahoo - that was very useful.

    I can see in that log you do indeed have 9,990 syscalls in progress. All except for one of these is a call to sycall.Lstat.

    Go has to start a real OS thread to run a syscall, so running 10,000 simultaneous Lstat calls needs 10,000 threads.

    It is possible to increase that 10,000 number by calling runtime.SetMaxThreads however I'd like to investigate exactly why there are 10,000 Lstat calls happening as that doesn't seem right to me.

    We don't call Lstat in parallel in the directory listing routines so there should be at most 2 * --checkers of these so 256. Likewise when processing --files-from we should only be processing another 256 simultaneous Lstat calls which leaves 500 in total which is a very long way from 10,000.

    All the calls to Lstat originate from this line

    dst, err := m.Fdst.NewObject(m.Ctx, path.Join(job.dstRemote, leaf))

    This only happens if --no-traverse is set

    The root cause is that we call NewObject and hence Lstat a total of --checkers * --checkers times in parallel when --files-from and --no-traverse are in use which exceeds the 10,000 thread limit.

    I've attempted to fix this with a weighted semaphore which calls NewObject a maximum of --checkers times simultaneously (which is what the code intended all along).

    Please give this a go - thanks

    v1.73.0-beta.9374.8bcb1bde1.fix-9073-march-thread-limit on branch fix-9073-march-thread-limit (uploaded in 15-30 mins)

  5. microyahoo commented on Jan 4, 2026

    @microyahoo
    Author

    hi @ncw, thank you for quickly identifying the issue and providing the hotfix in such a short time. We're currently migrating a large amount of data to the new filesystem. However, this issue is quite difficult to reproduce as it seems to be related to both node load and the filesystem. I'll do my best to try and reproduce it later, though it may take some time. Thanks again!

  6. ncw commented on Jan 6, 2026

    @ncw
    Member

    I've never seen this error from Go before so you must win some kind of prize for that :-)

    I'm not 100% satisfied with the fix since it is still making --checkers * --checkers goroutines. This isn't a problem for the go runtime but it is untidy. However I went with the minimum fix for max chance of correctness.

    Let me know how it goes @microyahoo

  7. added a commit that references this issue on Feb 17, 2026
    b52fab6
  8. added a commit that references this issue on Jul 20, 2026
    2362ceb
  9. added a commit that references this issue on Nov 21, 2026
    9951bf3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions