可能的死锁
#221
Replies: 4 comments 1 reply
-
|
有没有实际代码可以复现? |
Beta Was this translation helpful? Give feedback.
1 reply
-
func (apiClient *ApiAsyncClient) DoAsync(retry int) error {
return apiClient.scheduler.Submit(func() error {
_, err := apiClient.Do()
if err != nil {
if retry < apiClient.maxRetry {
return apiClient.DoAsync(retry+1)
}
}
return err
})
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
你这不是死锁吧,只是把 pool 用完了,自然就阻塞住了,如果不想 pool 用完之后阻塞住就设置一下非阻塞 submit,还有下次用 markdown 语法格式化一下代码。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
对,我的理解就是pool用完了导致的死锁,目前我们是增加了一个subpool来处理
…________________________________
发件人: Andy Pan ***@***.***>
发送时间: 2022年5月5日 17:49
收件人: panjf2000/ants ***@***.***>
抄送: Yingchu Chen ***@***.***>; Author ***@***.***>
主题: Re: [panjf2000/ants] 可能的死锁 (Discussion #221)
你这不是死锁吧,只是把 pool 用完了,自然就阻塞住了,如果不想 pool 用完之后阻塞住就设置一下非阻塞 submit,还有下次用 markdown 语法格式化一下代码。
―
Reply to this email directly, view it on GitHub<#221 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJMK3CKDNIECU2KG5AA7GLDVIOKSVANCNFSM5UIZACAQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
不知道大家在使用的时候有没有遇到submit里面再在当前pool中再submit的情况,这种情况会进而引发死锁,目前我是用一个sub pool来解决的,不知道大家遇到的时候是怎么做的?
Beta Was this translation helpful? Give feedback.
All reactions