You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dolphinscheduler.apache.org by "lgcareer2019@outlook.com" <lg...@outlook.com> on 2020/05/11 10:56:24 UTC

Re: Re:introduce retryer for async function

I also agree with it.
It's better to abstract diffrent retry policy class in order to reuse easier.



DolphinScheduler(Incubator) PPMC
Gang Li 李岗

lgcareer2019@outlook.com<ma...@outlook.com>
 
发件人: GabryWu
发送时间: 2020-05-11 18:30
收件人: dev
抄送: wu_shao_jie; qiaozhanwei
主题: Re:Re: 回复:introduce retryer for async function
yes,agree with you.
It's better let's others know when should or not use the retryer,otherwise a retry hell reached
 
------------------ 原始邮件 ------------------
发件人:&nbsp;"qiaozhanwei@outlook.com" <qiaozhanwei@outlook.com&gt;;
发送时间:&nbsp;2020年5月11日(星期一) 18:19
收件人:&nbsp;"dev" <dev@dolphinscheduler.apache.org&gt;;
抄送:&nbsp;"我的QQ邮箱" <wu_shao_jie@qq.com&gt;;
主题:&nbsp;Re: 回复:introduce retryer for async function
 
 
 
great
 
I think it is best to encapsulate a tool class, because it needs to be called in many places, not only in ack and response
 
 
—————————————
DolphinScheduler(Incubator)&nbsp; PPMC
Zhanwei Qiao 乔占卫
 
qiaozhanwei@outlook.com
&nbsp;
发件人: GabryWu
发送时间: 2020-05-11 17:33
收件人: dev
抄送: 我的QQ邮箱
主题: 回复:introduce retryer for async function
I created one PR: https://github.com/apache/incubator-dolphinscheduler/pull/2679
 
 
------------------ 原始邮件 ------------------
发件人: "GabryWu"<wu_shao_jie@qq.com&gt;;
发送时间: 2020年5月11日(星期一) 中午1:01
收件人: "dev"<dev@dolphinscheduler.apache.org&gt;;
主题: introduce retryer for async function
 
Now, dolphin already refactor worker ,and netty is being used.
It can be predicted that async method will be more and more used ,and function retryer is necessary .
If we simply call function twice or more , it's ugly and beyonds understanding
 
So I suggest we introduce a retryer class ,for example https://github.com/rholder/guava-retrying

回复: Re:introduce retryer for async function

Posted by GabryWu <wu...@qq.com>.
I create a new PR,&nbsp;https://github.com/apache/incubator-dolphinscheduler/pull/2679
Because I'm not sure which methods will use the Retryer, so I just create RetryerUtils which main function is retryCall&nbsp;
that will retry 3 times if exceptions throw or return result is false and wait 1 second between each retry


Please let me know if you have any suggestions



------------------&nbsp;原始邮件&nbsp;------------------
发件人:&nbsp;"GabryWu"<wu_shao_jie@qq.com&gt;;
发送时间:&nbsp;2020年5月12日(星期二) 上午8:36
收件人:&nbsp;"dev"<dev@dolphinscheduler.apache.org&gt;;
抄送:&nbsp;"lgcareer2019"<lgcareer2019@outlook.com&gt;;
主题:&nbsp;回复: Re:introduce retryer for async function



Cool, It seems to be a general logic, I will abstract different retry policy classes which can be reused easier




------------------ 原始邮件 ------------------
发件人:&nbsp;"lgcareer2019"<lgcareer2019@outlook.com&gt;;
发送时间:&nbsp;2020年5月11日(星期一) 晚上6:56
收件人:&nbsp;"dev"<dev@dolphinscheduler.apache.org&gt;;
抄送:&nbsp;"GabryWu"<wu_shao_jie@qq.com&gt;;"qiaozhanwei"<qiaozhanwei@outlook.com&gt;;
主题:&nbsp;Re: Re:introduce retryer for async function



I also agree with it.
It's better to abstract diffrent retry policy class in order to reuse easier.



DolphinScheduler(Incubator) PPMC
Gang Li 李岗

lgcareer2019@outlook.com<mailto:lgcareer2019@outlook.com&gt;
&nbsp;
发件人: GabryWu
发送时间: 2020-05-11 18:30
收件人: dev
抄送: wu_shao_jie; qiaozhanwei
主题: Re:Re: 回复:introduce retryer for async function
yes,agree with you.
It's better let's others know when should or not use the retryer,otherwise a retry hell reached
&nbsp;
------------------ 原始邮件 ------------------
发件人:&amp;nbsp;"qiaozhanwei@outlook.com" <qiaozhanwei@outlook.com&amp;gt;;
发送时间:&amp;nbsp;2020年5月11日(星期一) 18:19
收件人:&amp;nbsp;"dev" <dev@dolphinscheduler.apache.org&amp;gt;;
抄送:&amp;nbsp;"我的QQ邮箱" <wu_shao_jie@qq.com&amp;gt;;
主题:&amp;nbsp;Re: 回复:introduce retryer for async function
&nbsp;
&nbsp;
&nbsp;
great
&nbsp;
I think it is best to encapsulate a tool class, because it needs to be called in many places, not only in ack and response
&nbsp;
&nbsp;
—————————————
DolphinScheduler(Incubator)&amp;nbsp; PPMC
Zhanwei Qiao 乔占卫
&nbsp;
qiaozhanwei@outlook.com
&amp;nbsp;
发件人: GabryWu
发送时间: 2020-05-11 17:33
收件人: dev
抄送: 我的QQ邮箱
主题: 回复:introduce retryer for async function
I created one PR: https://github.com/apache/incubator-dolphinscheduler/pull/2679
&nbsp;
&nbsp;
------------------ 原始邮件 ------------------
发件人: "GabryWu"<wu_shao_jie@qq.com&amp;gt;;
发送时间: 2020年5月11日(星期一) 中午1:01
收件人: "dev"<dev@dolphinscheduler.apache.org&amp;gt;;
主题: introduce retryer for async function
&nbsp;
Now, dolphin already refactor worker ,and netty is being used.
It can be predicted that async method will be more and more used ,and function retryer is necessary .
If we simply call function twice or more , it's ugly and beyonds understanding
&nbsp;
So I suggest we introduce a retryer class ,for example https://github.com/rholder/guava-retrying

回复: Re:introduce retryer for async function

Posted by GabryWu <wu...@qq.com>.
Cool, It seems to be a general logic, I will abstract different retry policy classes which can be reused easier




------------------&nbsp;原始邮件&nbsp;------------------
发件人:&nbsp;"lgcareer2019"<lgcareer2019@outlook.com&gt;;
发送时间:&nbsp;2020年5月11日(星期一) 晚上6:56
收件人:&nbsp;"dev"<dev@dolphinscheduler.apache.org&gt;;
抄送:&nbsp;"GabryWu"<wu_shao_jie@qq.com&gt;;"qiaozhanwei"<qiaozhanwei@outlook.com&gt;;
主题:&nbsp;Re: Re:introduce retryer for async function



I also agree with it.
It's better to abstract diffrent retry policy class in order to reuse easier.



DolphinScheduler(Incubator) PPMC
Gang Li 李岗

lgcareer2019@outlook.com<mailto:lgcareer2019@outlook.com&gt;
&nbsp;
发件人: GabryWu
发送时间: 2020-05-11 18:30
收件人: dev
抄送: wu_shao_jie; qiaozhanwei
主题: Re:Re: 回复:introduce retryer for async function
yes,agree with you.
It's better let's others know when should or not use the retryer,otherwise a retry hell reached
&nbsp;
------------------ 原始邮件 ------------------
发件人:&amp;nbsp;"qiaozhanwei@outlook.com" <qiaozhanwei@outlook.com&amp;gt;;
发送时间:&amp;nbsp;2020年5月11日(星期一) 18:19
收件人:&amp;nbsp;"dev" <dev@dolphinscheduler.apache.org&amp;gt;;
抄送:&amp;nbsp;"我的QQ邮箱" <wu_shao_jie@qq.com&amp;gt;;
主题:&amp;nbsp;Re: 回复:introduce retryer for async function
&nbsp;
&nbsp;
&nbsp;
great
&nbsp;
I think it is best to encapsulate a tool class, because it needs to be called in many places, not only in ack and response
&nbsp;
&nbsp;
—————————————
DolphinScheduler(Incubator)&amp;nbsp; PPMC
Zhanwei Qiao 乔占卫
&nbsp;
qiaozhanwei@outlook.com
&amp;nbsp;
发件人: GabryWu
发送时间: 2020-05-11 17:33
收件人: dev
抄送: 我的QQ邮箱
主题: 回复:introduce retryer for async function
I created one PR: https://github.com/apache/incubator-dolphinscheduler/pull/2679
&nbsp;
&nbsp;
------------------ 原始邮件 ------------------
发件人: "GabryWu"<wu_shao_jie@qq.com&amp;gt;;
发送时间: 2020年5月11日(星期一) 中午1:01
收件人: "dev"<dev@dolphinscheduler.apache.org&amp;gt;;
主题: introduce retryer for async function
&nbsp;
Now, dolphin already refactor worker ,and netty is being used.
It can be predicted that async method will be more and more used ,and function retryer is necessary .
If we simply call function twice or more , it's ugly and beyonds understanding
&nbsp;
So I suggest we introduce a retryer class ,for example https://github.com/rholder/guava-retrying