-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(baidu_netdisk): deplicate retry #7972
base: main
Are you sure you want to change the base?
Conversation
是符合预期,假如在某一时刻同时启动了3个协程,只有当其中一个协程错误次数超过3次(retry.Attempts(3))时ctx才会取消,而在前两次错误时ctx不会取消所以会表现出遇到错误但依旧在上传后续分片,因为错误的协程还在重试。 |
我是在调最大分片数量的时候遇到的,当时并发开太高了,10之前就已经 retry 丢出 error( |
写的时候没注意,retry 设了一个重试, resty 也有一个重试,导致一共重试了9次😂。 |
所以是 |
如果只是两层重试的话也只是重试次数多一点,不会出现错误没法打断后续执行的情况吧 |
你可以再试试,没有问题的。只是日志 error 错误(不是warning )要出现3次,这个日志是RestyClient 打印的,errgroup 不打印日志 |
改了回头再观察一下吧,RestyClient的日志没保存到日志文件里,stdout我没顺手保存下来 |
@xhofe merge this? |
不知道是不是 进过 errgroup 和 resty 之后, ctx 有问题。
出错了也还会把 threadG 剩下的线程执行完,这不符合预期。
尝试修复了一下,不知道这样对不对,麻烦大佬帮忙看一下。