You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dubbo.apache.org by Ian Luo <ia...@gmail.com> on 2018/10/30 03:19:51 UTC

pull request 2686

Xiaobo,

Would you mind to take a look at the comments I dropped on pull request
2686 [1] you proposed? Basically I think we could completely remove isDelay
method, if you agree with this idea, pls. follow up to enhance your pull
request.

Thanks,
-Ian.

1. https://github.com/apache/incubator-dubbo/pull/2686

Re: pull request 2686

Posted by 田 小波 <ti...@outlook.com>.
OK. I will read it carefully on this weekend.

-xiaobo

> 在 2018年11月2日,上午11:30,Ian Luo <ia...@gmail.com> 写道:
> 
> Then Xiaobo, I am looking forward to merging your another pull request for
> doc update :). You should start to look into website project [1]. Pls. read
> its README to understand how to build it.
> 
> Thanks,
> -Ian.
> 
> 1. https://github.com/apache/incubator-dubbo-website
> 
> On Fri, Nov 2, 2018 at 11:15 AM 田 小波 <ti...@outlook.com> wrote:
> 
>> OK. I got it.
>> 
>>> 在 2018年11月2日,上午11:10,jun liu <ke...@gmail.com> 写道:
>>> 
>>>> Nice! if needed, May I help to update the doc about delay exposure when
>> PR-2686 is released at next release or later.
>>> 
>>> That would be great. Docs are the part I forget to mention. You can
>> submit a PR to the dubbo-website project hosted here:
>>> https://github.com/apache/incubator-dubbo-website
>>> 
>>> Best regards,
>>> Jun
>>> 
>>>> On Nov 2, 2018, at 10:49 AM, 田 小波 <ti...@outlook.com> wrote:
>>>> 
>>>> Nice! if needed, May I help to update the doc about delay exposure when
>> PR-2686 is released at next release or later.
>>>> 
>>>> 在 2018年11月2日,上午10:07,Ian Luo <ian.luo@gmail.com<mailto:
>> ian.luo@gmail.com>> 写道:
>>>> 
>>>> To make sure I understand the change affect right, is the following and
>> the corresponding action right (for spring supports application listener)?
>>>> Export always being executed after Spring Context initialized properly
>> despite the delay value, and the delay times after that is:
>>>> * delay=null, no delay
>>>> * delay=0, no delay
>>>> * delay=-1 or delay=-5000, no delay
>>>> * delay=5000, delay for 5s.
>>>> 
>>>> Correct, this is what I understand too.
>>>> 
>>>> On Fri, Nov 2, 2018 at 9:51 AM jun liu <ken.lj.hz@gmail.com<mailto:
>> ken.lj.hz@gmail.com>> wrote:
>>>>> To conclude, Dubbo should start to expose services until spring context
>>>>> gets refreshed, no matter delay or no-delay is configured.
>>>> 
>>>> +1, agree with this logic as the default for the export process.
>>>> 
>>>>> Unfortunately in
>>>>> order to keep backward compatibility, considering not all spring
>> versions
>>>>> support context refresh callback, we have to start to expose services
>> after
>>>>> properties set if we find application listener is not supported, and
>> hope
>>>>> Dubbo service can be exposed normally.
>>>> 
>>>> At first, I tend to remove the compatibility purpose snippet, because
>> spring versions without application listener support seems to be v2.0.0 or
>> earlier which must have been announced EOL long ago and may have few users.
>> But since the critical export process will never be triggered if removed, I
>> think it’s ok to continue keep it.
>>>> 
>>>> To make sure I understand the change affect right, is the following and
>> the corresponding action right (for spring supports application listener)?
>>>> 
>>>> Export always being executed after Spring Context initialized properly
>> despite the delay value, and the delay times after that is:
>>>> * delay=null, no delay
>>>> * delay=0, no delay
>>>> * delay=-1 or delay=-5000, no delay
>>>> * delay=5000, delay for 5s.
>>>> 
>>>> Best regards,
>>>> Jun
>>>> 
>>>>> On Nov 1, 2018, at 10:39 AM, Ian Luo <ian.luo@gmail.com<mailto:
>> ian.luo@gmail.com>> wrote:
>>>>> 
>>>>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent
>> 调用,而不是
>>>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>>>> 
>>>>> I think this behavior is expected. The reason is, the best timing for
>> Dubbo
>>>>> to count down delay for exposing service is when Spring container is
>> ready,
>>>>> then this timing should be the moment when spring context gets
>> refreshed,
>>>>> since at this moment, all beans are settled, and are ready for wiring
>> in
>>>>> their dependencies. If it happens earlier, say, at the moment after
>>>>> properties set, then Dubbo may fail to expose service because it
>> depends on
>>>>> other spring bean.
>>>>> 
>>>>> To conclude, Dubbo should start to expose services until spring context
>>>>> gets refreshed, no matter delay or no-delay is configured.
>> Unfortunately in
>>>>> order to keep backward compatibility, considering not all spring
>> versions
>>>>> support context refresh callback, we have to start to expose services
>> after
>>>>> properties set if we find application listener is not supported, and
>> hope
>>>>> Dubbo service can be exposed normally.
>>>>> 
>>>>> I hope this can clarify the behavior.
>>>>> 
>>>>> -Ian.
>>>>> 
>>>>> 
>>>>> 
>>>>> On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yiji@apache.org<mailto:
>> yiji@apache.org>> wrote:
>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>>>>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent
>> 调用
>>>>>> export 暴露服务
>>>>>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>>>>>> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
>>>>>> 
>>>>>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>>>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent
>> 调用,而不是
>>>>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>>>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>>>>> 
>>>>>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>>>>>> 
>>>>>> Yes, you are right.
>>>>>> 
>>>>>> yiji
>>>>>> 
>>>>>> 田 小波 <ti...@outlook.com>>
>> 于2018年11月1日周四 上午1:25写道:
>>>>>> 
>>>>>>> Hi,
>>>>>>> 
>>>>>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>>>>>> 
>>>>>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent
>> 调用
>>>>>>> export 暴露服务
>>>>>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>>>>>>> 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
>>>>>>> 
>>>>>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>>>>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent
>> 调用,而不是
>>>>>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>>>>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>>>>>> 
>>>>>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>>>>>>> 
>>>>>>> - xiaobo
>>>>>>> 
>>>>>>> 在 2018年10月31日,下午10:43,Zonghai Shang <yiji@apache.org<mailto:
>> yiji@apache.org>> 写道:
>>>>>>> 
>>>>>>> Hi,
>>>>>>> 
>>>>>>> 我认为这种修改会造成延迟暴露的bug。
>>>>>>> 如果要在容器启动10秒后才进行服务暴露怎么办?
>>>>>>> 原始意图delay= 10000表示10秒后执行。
>>>>>>> 
>>>>>>> I think this modification will cause a delay in the exposure of the
>> bug.
>>>>>>> What if you want to expose the service 10 seconds after the spring
>>>>>>> container started ?
>>>>>>> The original intention delay = 10000 represents execution after 10
>>>>>>> seconds.
>>>>>>> 
>>>>>>> public synchronized void export() {
>>>>>>> if (delay != null && delay > 0) {
>>>>>>>    // should be delay, eg: 1 seconds
>>>>>>>     delayExportExecutor.schedule(new Runnable() {
>>>>>>>         @Override
>>>>>>>         public void run() {
>>>>>>>             doExport();
>>>>>>>         }
>>>>>>>     }, delay, TimeUnit.MILLISECONDS);
>>>>>>> } else {
>>>>>>>     doExport();
>>>>>>> }
>>>>>>> }
>>>>>>> 
>>>>>>> yiji
>>>>>>> 
>>>>>>> Ian Luo <ia...@gmail.com>>
>> 于2018年10月31日周三 下午5:50写道:
>>>>>>> 
>>>>>>>> good good study, day day up. Looking forward to your contribution :)
>>>>>>>> 
>>>>>>>> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <tianxiaobo.com@outlook.com
>> <ma...@outlook.com>>
>>>>>> wrote:
>>>>>>>> 
>>>>>>>>> Yes, in fact, It is a plan. I'm learning Dubbo code by writing
>> blogs
>>>>>>>> way,
>>>>>>>>> It can make me understand Dubbo code deeply. So, I need to finish
>> my
>>>>>>>> blogs
>>>>>>>>> first before doing other thing.
>>>>>>>>> 
>>>>>>>>> 在 2018年10月31日,下午3:11,Ian Luo <ian.luo@gmail.com<mailto:
>> ian.luo@gmail.com>> 写道:
>>>>>>>>> 
>>>>>>>>> sounds like a plan :)
>>>>>>>>> 
>>>>>>>>> Thanks,
>>>>>>>>> -Ian.
>>>>>>>>> 
>>>>>>>>> On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <tianxiaobo.com@outlook.com
>> <ma...@outlook.com>>
>>>>>>>> wrote:
>>>>>>>>> 
>>>>>>>>>> OK. I will read these articles carefully and think about how to
>>>>>> enhance
>>>>>>>>>> them next month or later. Please wait.
>>>>>>>>>> 
>>>>>>>>>> 在 2018年10月31日,下午2:26,Ian Luo <ian.luo@gmail.com<mailto:
>> ian.luo@gmail.com>> 写道:
>>>>>>>>>> 
>>>>>>>>>> Excellent post. You may consider to enhance
>>>>>>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
>>>>>> and
>>>>>>>>>> 
>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
>>>>>>>>>> 
>>>>>>>>>> -Ian.
>>>>>>>>>> 
>>>>>>>>>> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <tianxiaobo.com@outlook.com
>> <ma...@outlook.com>>
>>>>>>>> wrote:
>>>>>>>>>> 
>>>>>>>>>>> Luo Ian:
>>>>>>>>>>> 
>>>>>>>>>>> I will contribute more for Dubbo community in the future. I'm
>> going
>>>>>> to
>>>>>>>>>>> submit a new PR to dubbo-website after my Dubbo blogs are
>> finished.
>>>>>> I
>>>>>>>> am
>>>>>>>>>>> now hastening to write blogs, and two blogs has bean finished. I
>>>>>> will
>>>>>>>>>>> finish remaining blogs next month. The first blog "Dubbo 源码分析 -
>> SPI
>>>>>> 机制
>>>>>>>>>>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
>>>>>> published
>>>>>>>>>>> on cnblogs.com<http://cnblogs.com/>. You may read it and give
>> me some guidance if you
>>>>>> have
>>>>>>>>>>> interest and time, thanks.
>>>>>>>>>>> 
>>>>>>>>>>> Best wishes,
>>>>>>>>>>> -xiaobo.
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> 在 2018年10月31日,上午10:08,Ian Luo <ian.luo@gmail.com<mailto:
>> ian.luo@gmail.com>> 写道:
>>>>>>>>>>> 
>>>>>>>>>>> XiaoBo,
>>>>>>>>>>> 
>>>>>>>>>>> Nice! Pls. consider contributing more to the community in the
>>>>>> future.
>>>>>>>>>>> 
>>>>>>>>>>> Recently, I have bean writing a series of blogs about Dubbo
>>>>>>>>>>> 
>>>>>>>>>>> Pls. share the link with the community (send email to
>>>>>>>>>>> dev@dubbo.apache.org<ma...@dubbo.apache.org>) once you
>> finish :) You can also consider to
>>>>>>>> post
>>>>>>>>>>> your article to Dubbo's website [1]. It will become another pull
>>>>>>>> request
>>>>>>>>>>> from you by the way :)
>>>>>>>>>>> 
>>>>>>>>>>> Thanks,
>>>>>>>>>>> -Ian.
>>>>>>>>>>> 
>>>>>>>>>>> 1. https://github.com/apache/incubator-dubbo-website
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <tianxiaobo.com@outlook.com
>> <ma...@outlook.com>>
>>>>>>>> wrote:
>>>>>>>>>>> 
>>>>>>>>>>>> Luo lan:
>>>>>>>>>>>> Thanks to merge my PR. It is my first PR, I feel very exciting.
>>>>>>>>>>>> Recently, I have bean writing a series of blogs about Dubbo.
>> And, I
>>>>>>>> expect
>>>>>>>>>>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
>>>>>>>> popularity.
>>>>>>>>>>>> Best wishes.
>>>>>>>>>>>> 
>>>>>>>>>>>> 在 2018年10月30日,下午5:14,Ian Luo <ian.luo@gmail.com<mailto:
>> ian.luo@gmail.com>> 写道:
>>>>>>>>>>>> 
>>>>>>>>>>>> Xiaobo,
>>>>>>>>>>>> 
>>>>>>>>>>>> I notice that you've already updated pull request. Now the
>> change
>>>>>>>> looks
>>>>>>>>>>>> good, and I've merged your pull request.
>>>>>>>>>>>> 
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> -Ian.
>>>>>>>>>>>> 
>>>>>>>>>>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ian.luo@gmail.com
>> <ma...@gmail.com>>
>>>>>> wrote:
>>>>>>>>>>>> 
>>>>>>>>>>>>> Xiaobo,
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Would you mind to take a look at the comments I dropped on pull
>>>>>>>>>>>>> request 2686 [1] you proposed? Basically I think we could
>>>>>>>> completely remove
>>>>>>>>>>>>> isDelay method, if you agree with this idea, pls. follow up to
>>>>>>>> enhance your
>>>>>>>>>>>>> pull request.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>> -Ian.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
>>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 


Re: pull request 2686

Posted by Ian Luo <ia...@gmail.com>.
Then Xiaobo, I am looking forward to merging your another pull request for
doc update :). You should start to look into website project [1]. Pls. read
its README to understand how to build it.

Thanks,
-Ian.

1. https://github.com/apache/incubator-dubbo-website

On Fri, Nov 2, 2018 at 11:15 AM 田 小波 <ti...@outlook.com> wrote:

> OK. I got it.
>
> > 在 2018年11月2日,上午11:10,jun liu <ke...@gmail.com> 写道:
> >
> >> Nice! if needed, May I help to update the doc about delay exposure when
> PR-2686 is released at next release or later.
> >
> > That would be great. Docs are the part I forget to mention. You can
> submit a PR to the dubbo-website project hosted here:
> > https://github.com/apache/incubator-dubbo-website
> >
> > Best regards,
> > Jun
> >
> >> On Nov 2, 2018, at 10:49 AM, 田 小波 <ti...@outlook.com> wrote:
> >>
> >> Nice! if needed, May I help to update the doc about delay exposure when
> PR-2686 is released at next release or later.
> >>
> >> 在 2018年11月2日,上午10:07,Ian Luo <ian.luo@gmail.com<mailto:
> ian.luo@gmail.com>> 写道:
> >>
> >> To make sure I understand the change affect right, is the following and
> the corresponding action right (for spring supports application listener)?
> >> Export always being executed after Spring Context initialized properly
> despite the delay value, and the delay times after that is:
> >> * delay=null, no delay
> >> * delay=0, no delay
> >> * delay=-1 or delay=-5000, no delay
> >> * delay=5000, delay for 5s.
> >>
> >> Correct, this is what I understand too.
> >>
> >> On Fri, Nov 2, 2018 at 9:51 AM jun liu <ken.lj.hz@gmail.com<mailto:
> ken.lj.hz@gmail.com>> wrote:
> >>> To conclude, Dubbo should start to expose services until spring context
> >>> gets refreshed, no matter delay or no-delay is configured.
> >>
> >> +1, agree with this logic as the default for the export process.
> >>
> >>> Unfortunately in
> >>> order to keep backward compatibility, considering not all spring
> versions
> >>> support context refresh callback, we have to start to expose services
> after
> >>> properties set if we find application listener is not supported, and
> hope
> >>> Dubbo service can be exposed normally.
> >>
> >> At first, I tend to remove the compatibility purpose snippet, because
> spring versions without application listener support seems to be v2.0.0 or
> earlier which must have been announced EOL long ago and may have few users.
> But since the critical export process will never be triggered if removed, I
> think it’s ok to continue keep it.
> >>
> >> To make sure I understand the change affect right, is the following and
> the corresponding action right (for spring supports application listener)?
> >>
> >> Export always being executed after Spring Context initialized properly
> despite the delay value, and the delay times after that is:
> >> * delay=null, no delay
> >> * delay=0, no delay
> >> * delay=-1 or delay=-5000, no delay
> >> * delay=5000, delay for 5s.
> >>
> >> Best regards,
> >> Jun
> >>
> >>> On Nov 1, 2018, at 10:39 AM, Ian Luo <ian.luo@gmail.com<mailto:
> ian.luo@gmail.com>> wrote:
> >>>
> >>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> >>> supportedApplicationListener = true 时,export 会被 onApplicationEvent
> 调用,而不是
> >>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> >>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> >>>
> >>> I think this behavior is expected. The reason is, the best timing for
> Dubbo
> >>> to count down delay for exposing service is when Spring container is
> ready,
> >>> then this timing should be the moment when spring context gets
> refreshed,
> >>> since at this moment, all beans are settled, and are ready for wiring
> in
> >>> their dependencies. If it happens earlier, say, at the moment after
> >>> properties set, then Dubbo may fail to expose service because it
> depends on
> >>> other spring bean.
> >>>
> >>> To conclude, Dubbo should start to expose services until spring context
> >>> gets refreshed, no matter delay or no-delay is configured.
> Unfortunately in
> >>> order to keep backward compatibility, considering not all spring
> versions
> >>> support context refresh callback, we have to start to expose services
> after
> >>> properties set if we find application listener is not supported, and
> hope
> >>> Dubbo service can be exposed normally.
> >>>
> >>> I hope this can clarify the behavior.
> >>>
> >>> -Ian.
> >>>
> >>>
> >>>
> >>> On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yiji@apache.org<mailto:
> yiji@apache.org>> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> >>>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent
> 调用
> >>>> export 暴露服务
> >>>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> >>>> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
> >>>>
> >>>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> >>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent
> 调用,而不是
> >>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> >>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> >>>>
> >>>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
> >>>>
> >>>> Yes, you are right.
> >>>>
> >>>> yiji
> >>>>
> >>>> 田 小波 <ti...@outlook.com>>
> 于2018年11月1日周四 上午1:25写道:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> >>>>>
> >>>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent
> 调用
> >>>>> export 暴露服务
> >>>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> >>>>> 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
> >>>>>
> >>>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> >>>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent
> 调用,而不是
> >>>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> >>>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> >>>>>
> >>>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
> >>>>>
> >>>>> - xiaobo
> >>>>>
> >>>>> 在 2018年10月31日,下午10:43,Zonghai Shang <yiji@apache.org<mailto:
> yiji@apache.org>> 写道:
> >>>>>
> >>>>> Hi,
> >>>>>
> >>>>> 我认为这种修改会造成延迟暴露的bug。
> >>>>> 如果要在容器启动10秒后才进行服务暴露怎么办?
> >>>>> 原始意图delay= 10000表示10秒后执行。
> >>>>>
> >>>>> I think this modification will cause a delay in the exposure of the
> bug.
> >>>>> What if you want to expose the service 10 seconds after the spring
> >>>>> container started ?
> >>>>> The original intention delay = 10000 represents execution after 10
> >>>>> seconds.
> >>>>>
> >>>>> public synchronized void export() {
> >>>>>  if (delay != null && delay > 0) {
> >>>>>     // should be delay, eg: 1 seconds
> >>>>>      delayExportExecutor.schedule(new Runnable() {
> >>>>>          @Override
> >>>>>          public void run() {
> >>>>>              doExport();
> >>>>>          }
> >>>>>      }, delay, TimeUnit.MILLISECONDS);
> >>>>>  } else {
> >>>>>      doExport();
> >>>>>  }
> >>>>> }
> >>>>>
> >>>>> yiji
> >>>>>
> >>>>> Ian Luo <ia...@gmail.com>>
> 于2018年10月31日周三 下午5:50写道:
> >>>>>
> >>>>>> good good study, day day up. Looking forward to your contribution :)
> >>>>>>
> >>>>>> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <tianxiaobo.com@outlook.com
> <ma...@outlook.com>>
> >>>> wrote:
> >>>>>>
> >>>>>>> Yes, in fact, It is a plan. I'm learning Dubbo code by writing
> blogs
> >>>>>> way,
> >>>>>>> It can make me understand Dubbo code deeply. So, I need to finish
> my
> >>>>>> blogs
> >>>>>>> first before doing other thing.
> >>>>>>>
> >>>>>>> 在 2018年10月31日,下午3:11,Ian Luo <ian.luo@gmail.com<mailto:
> ian.luo@gmail.com>> 写道:
> >>>>>>>
> >>>>>>> sounds like a plan :)
> >>>>>>>
> >>>>>>> Thanks,
> >>>>>>> -Ian.
> >>>>>>>
> >>>>>>> On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <tianxiaobo.com@outlook.com
> <ma...@outlook.com>>
> >>>>>> wrote:
> >>>>>>>
> >>>>>>>> OK. I will read these articles carefully and think about how to
> >>>> enhance
> >>>>>>>> them next month or later. Please wait.
> >>>>>>>>
> >>>>>>>> 在 2018年10月31日,下午2:26,Ian Luo <ian.luo@gmail.com<mailto:
> ian.luo@gmail.com>> 写道:
> >>>>>>>>
> >>>>>>>> Excellent post. You may consider to enhance
> >>>>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
> >>>> and
> >>>>>>>>
> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
> >>>>>>>>
> >>>>>>>> -Ian.
> >>>>>>>>
> >>>>>>>> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <tianxiaobo.com@outlook.com
> <ma...@outlook.com>>
> >>>>>> wrote:
> >>>>>>>>
> >>>>>>>>> Luo Ian:
> >>>>>>>>>
> >>>>>>>>> I will contribute more for Dubbo community in the future. I'm
> going
> >>>> to
> >>>>>>>>> submit a new PR to dubbo-website after my Dubbo blogs are
> finished.
> >>>> I
> >>>>>> am
> >>>>>>>>> now hastening to write blogs, and two blogs has bean finished. I
> >>>> will
> >>>>>>>>> finish remaining blogs next month. The first blog "Dubbo 源码分析 -
> SPI
> >>>> 机制
> >>>>>>>>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
> >>>> published
> >>>>>>>>> on cnblogs.com<http://cnblogs.com/>. You may read it and give
> me some guidance if you
> >>>> have
> >>>>>>>>> interest and time, thanks.
> >>>>>>>>>
> >>>>>>>>> Best wishes,
> >>>>>>>>> -xiaobo.
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> 在 2018年10月31日,上午10:08,Ian Luo <ian.luo@gmail.com<mailto:
> ian.luo@gmail.com>> 写道:
> >>>>>>>>>
> >>>>>>>>> XiaoBo,
> >>>>>>>>>
> >>>>>>>>> Nice! Pls. consider contributing more to the community in the
> >>>> future.
> >>>>>>>>>
> >>>>>>>>> Recently, I have bean writing a series of blogs about Dubbo
> >>>>>>>>>
> >>>>>>>>> Pls. share the link with the community (send email to
> >>>>>>>>> dev@dubbo.apache.org<ma...@dubbo.apache.org>) once you
> finish :) You can also consider to
> >>>>>> post
> >>>>>>>>> your article to Dubbo's website [1]. It will become another pull
> >>>>>> request
> >>>>>>>>> from you by the way :)
> >>>>>>>>>
> >>>>>>>>> Thanks,
> >>>>>>>>> -Ian.
> >>>>>>>>>
> >>>>>>>>> 1. https://github.com/apache/incubator-dubbo-website
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <tianxiaobo.com@outlook.com
> <ma...@outlook.com>>
> >>>>>> wrote:
> >>>>>>>>>
> >>>>>>>>>> Luo lan:
> >>>>>>>>>>  Thanks to merge my PR. It is my first PR, I feel very exciting.
> >>>>>>>>>> Recently, I have bean writing a series of blogs about Dubbo.
> And, I
> >>>>>> expect
> >>>>>>>>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
> >>>>>> popularity.
> >>>>>>>>>>  Best wishes.
> >>>>>>>>>>
> >>>>>>>>>> 在 2018年10月30日,下午5:14,Ian Luo <ian.luo@gmail.com<mailto:
> ian.luo@gmail.com>> 写道:
> >>>>>>>>>>
> >>>>>>>>>> Xiaobo,
> >>>>>>>>>>
> >>>>>>>>>> I notice that you've already updated pull request. Now the
> change
> >>>>>> looks
> >>>>>>>>>> good, and I've merged your pull request.
> >>>>>>>>>>
> >>>>>>>>>> Thanks,
> >>>>>>>>>> -Ian.
> >>>>>>>>>>
> >>>>>>>>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ian.luo@gmail.com
> <ma...@gmail.com>>
> >>>> wrote:
> >>>>>>>>>>
> >>>>>>>>>>> Xiaobo,
> >>>>>>>>>>>
> >>>>>>>>>>> Would you mind to take a look at the comments I dropped on pull
> >>>>>>>>>>> request 2686 [1] you proposed? Basically I think we could
> >>>>>> completely remove
> >>>>>>>>>>> isDelay method, if you agree with this idea, pls. follow up to
> >>>>>> enhance your
> >>>>>>>>>>> pull request.
> >>>>>>>>>>>
> >>>>>>>>>>> Thanks,
> >>>>>>>>>>> -Ian.
> >>>>>>>>>>>
> >>>>>>>>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
> >>>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>
> >>
> >
>
>

Re: pull request 2686

Posted by 田 小波 <ti...@outlook.com>.
OK. I got it.

> 在 2018年11月2日,上午11:10,jun liu <ke...@gmail.com> 写道:
> 
>> Nice! if needed, May I help to update the doc about delay exposure when PR-2686 is released at next release or later.
> 
> That would be great. Docs are the part I forget to mention. You can submit a PR to the dubbo-website project hosted here:
> https://github.com/apache/incubator-dubbo-website
> 
> Best regards,
> Jun
> 
>> On Nov 2, 2018, at 10:49 AM, 田 小波 <ti...@outlook.com> wrote:
>> 
>> Nice! if needed, May I help to update the doc about delay exposure when PR-2686 is released at next release or later.
>> 
>> 在 2018年11月2日,上午10:07,Ian Luo <ia...@gmail.com>> 写道:
>> 
>> To make sure I understand the change affect right, is the following and the corresponding action right (for spring supports application listener)?
>> Export always being executed after Spring Context initialized properly despite the delay value, and the delay times after that is:
>> * delay=null, no delay
>> * delay=0, no delay
>> * delay=-1 or delay=-5000, no delay
>> * delay=5000, delay for 5s.
>> 
>> Correct, this is what I understand too.
>> 
>> On Fri, Nov 2, 2018 at 9:51 AM jun liu <ke...@gmail.com>> wrote:
>>> To conclude, Dubbo should start to expose services until spring context
>>> gets refreshed, no matter delay or no-delay is configured.
>> 
>> +1, agree with this logic as the default for the export process.
>> 
>>> Unfortunately in
>>> order to keep backward compatibility, considering not all spring versions
>>> support context refresh callback, we have to start to expose services after
>>> properties set if we find application listener is not supported, and hope
>>> Dubbo service can be exposed normally.
>> 
>> At first, I tend to remove the compatibility purpose snippet, because spring versions without application listener support seems to be v2.0.0 or earlier which must have been announced EOL long ago and may have few users. But since the critical export process will never be triggered if removed, I think it’s ok to continue keep it.
>> 
>> To make sure I understand the change affect right, is the following and the corresponding action right (for spring supports application listener)?
>> 
>> Export always being executed after Spring Context initialized properly despite the delay value, and the delay times after that is:
>> * delay=null, no delay
>> * delay=0, no delay
>> * delay=-1 or delay=-5000, no delay
>> * delay=5000, delay for 5s.
>> 
>> Best regards,
>> Jun
>> 
>>> On Nov 1, 2018, at 10:39 AM, Ian Luo <ia...@gmail.com>> wrote:
>>> 
>>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>> 
>>> I think this behavior is expected. The reason is, the best timing for Dubbo
>>> to count down delay for exposing service is when Spring container is ready,
>>> then this timing should be the moment when spring context gets refreshed,
>>> since at this moment, all beans are settled, and are ready for wiring in
>>> their dependencies. If it happens earlier, say, at the moment after
>>> properties set, then Dubbo may fail to expose service because it depends on
>>> other spring bean.
>>> 
>>> To conclude, Dubbo should start to expose services until spring context
>>> gets refreshed, no matter delay or no-delay is configured. Unfortunately in
>>> order to keep backward compatibility, considering not all spring versions
>>> support context refresh callback, we have to start to expose services after
>>> properties set if we find application listener is not supported, and hope
>>> Dubbo service can be exposed normally.
>>> 
>>> I hope this can clarify the behavior.
>>> 
>>> -Ian.
>>> 
>>> 
>>> 
>>> On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yi...@apache.org>> wrote:
>>> 
>>>> Hi,
>>>> 
>>>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
>>>> export 暴露服务
>>>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>>>> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
>>>> 
>>>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>>> 
>>>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>>>> 
>>>> Yes, you are right.
>>>> 
>>>> yiji
>>>> 
>>>> 田 小波 <ti...@outlook.com>> 于2018年11月1日周四 上午1:25写道:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>>>> 
>>>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
>>>>> export 暴露服务
>>>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>>>>> 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
>>>>> 
>>>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>>>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>>>> 
>>>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>>>>> 
>>>>> - xiaobo
>>>>> 
>>>>> 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org>> 写道:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> 我认为这种修改会造成延迟暴露的bug。
>>>>> 如果要在容器启动10秒后才进行服务暴露怎么办?
>>>>> 原始意图delay= 10000表示10秒后执行。
>>>>> 
>>>>> I think this modification will cause a delay in the exposure of the bug.
>>>>> What if you want to expose the service 10 seconds after the spring
>>>>> container started ?
>>>>> The original intention delay = 10000 represents execution after 10
>>>>> seconds.
>>>>> 
>>>>> public synchronized void export() {
>>>>>  if (delay != null && delay > 0) {
>>>>>     // should be delay, eg: 1 seconds
>>>>>      delayExportExecutor.schedule(new Runnable() {
>>>>>          @Override
>>>>>          public void run() {
>>>>>              doExport();
>>>>>          }
>>>>>      }, delay, TimeUnit.MILLISECONDS);
>>>>>  } else {
>>>>>      doExport();
>>>>>  }
>>>>> }
>>>>> 
>>>>> yiji
>>>>> 
>>>>> Ian Luo <ia...@gmail.com>> 于2018年10月31日周三 下午5:50写道:
>>>>> 
>>>>>> good good study, day day up. Looking forward to your contribution :)
>>>>>> 
>>>>>> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com>>
>>>> wrote:
>>>>>> 
>>>>>>> Yes, in fact, It is a plan. I'm learning Dubbo code by writing blogs
>>>>>> way,
>>>>>>> It can make me understand Dubbo code deeply. So, I need to finish my
>>>>>> blogs
>>>>>>> first before doing other thing.
>>>>>>> 
>>>>>>> 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com>> 写道:
>>>>>>> 
>>>>>>> sounds like a plan :)
>>>>>>> 
>>>>>>> Thanks,
>>>>>>> -Ian.
>>>>>>> 
>>>>>>> On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com>>
>>>>>> wrote:
>>>>>>> 
>>>>>>>> OK. I will read these articles carefully and think about how to
>>>> enhance
>>>>>>>> them next month or later. Please wait.
>>>>>>>> 
>>>>>>>> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com>> 写道:
>>>>>>>> 
>>>>>>>> Excellent post. You may consider to enhance
>>>>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
>>>> and
>>>>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
>>>>>>>> 
>>>>>>>> -Ian.
>>>>>>>> 
>>>>>>>> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <ti...@outlook.com>>
>>>>>> wrote:
>>>>>>>> 
>>>>>>>>> Luo Ian:
>>>>>>>>> 
>>>>>>>>> I will contribute more for Dubbo community in the future. I'm going
>>>> to
>>>>>>>>> submit a new PR to dubbo-website after my Dubbo blogs are finished.
>>>> I
>>>>>> am
>>>>>>>>> now hastening to write blogs, and two blogs has bean finished. I
>>>> will
>>>>>>>>> finish remaining blogs next month. The first blog "Dubbo 源码分析 - SPI
>>>> 机制
>>>>>>>>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
>>>> published
>>>>>>>>> on cnblogs.com<http://cnblogs.com/>. You may read it and give me some guidance if you
>>>> have
>>>>>>>>> interest and time, thanks.
>>>>>>>>> 
>>>>>>>>> Best wishes,
>>>>>>>>> -xiaobo.
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com>> 写道:
>>>>>>>>> 
>>>>>>>>> XiaoBo,
>>>>>>>>> 
>>>>>>>>> Nice! Pls. consider contributing more to the community in the
>>>> future.
>>>>>>>>> 
>>>>>>>>> Recently, I have bean writing a series of blogs about Dubbo
>>>>>>>>> 
>>>>>>>>> Pls. share the link with the community (send email to
>>>>>>>>> dev@dubbo.apache.org<ma...@dubbo.apache.org>) once you finish :) You can also consider to
>>>>>> post
>>>>>>>>> your article to Dubbo's website [1]. It will become another pull
>>>>>> request
>>>>>>>>> from you by the way :)
>>>>>>>>> 
>>>>>>>>> Thanks,
>>>>>>>>> -Ian.
>>>>>>>>> 
>>>>>>>>> 1. https://github.com/apache/incubator-dubbo-website
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com>>
>>>>>> wrote:
>>>>>>>>> 
>>>>>>>>>> Luo lan:
>>>>>>>>>>  Thanks to merge my PR. It is my first PR, I feel very exciting.
>>>>>>>>>> Recently, I have bean writing a series of blogs about Dubbo. And, I
>>>>>> expect
>>>>>>>>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
>>>>>> popularity.
>>>>>>>>>>  Best wishes.
>>>>>>>>>> 
>>>>>>>>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com>> 写道:
>>>>>>>>>> 
>>>>>>>>>> Xiaobo,
>>>>>>>>>> 
>>>>>>>>>> I notice that you've already updated pull request. Now the change
>>>>>> looks
>>>>>>>>>> good, and I've merged your pull request.
>>>>>>>>>> 
>>>>>>>>>> Thanks,
>>>>>>>>>> -Ian.
>>>>>>>>>> 
>>>>>>>>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com>>
>>>> wrote:
>>>>>>>>>> 
>>>>>>>>>>> Xiaobo,
>>>>>>>>>>> 
>>>>>>>>>>> Would you mind to take a look at the comments I dropped on pull
>>>>>>>>>>> request 2686 [1] you proposed? Basically I think we could
>>>>>> completely remove
>>>>>>>>>>> isDelay method, if you agree with this idea, pls. follow up to
>>>>>> enhance your
>>>>>>>>>>> pull request.
>>>>>>>>>>> 
>>>>>>>>>>> Thanks,
>>>>>>>>>>> -Ian.
>>>>>>>>>>> 
>>>>>>>>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
>>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>> 
>> 
>> 
> 


Re: pull request 2686

Posted by jun liu <ke...@gmail.com>.
> Nice! if needed, May I help to update the doc about delay exposure when PR-2686 is released at next release or later.

That would be great. Docs are the part I forget to mention. You can submit a PR to the dubbo-website project hosted here:
https://github.com/apache/incubator-dubbo-website

Best regards,
Jun

> On Nov 2, 2018, at 10:49 AM, 田 小波 <ti...@outlook.com> wrote:
> 
> Nice! if needed, May I help to update the doc about delay exposure when PR-2686 is released at next release or later.
> 
> 在 2018年11月2日,上午10:07,Ian Luo <ia...@gmail.com>> 写道:
> 
> To make sure I understand the change affect right, is the following and the corresponding action right (for spring supports application listener)?
> Export always being executed after Spring Context initialized properly despite the delay value, and the delay times after that is:
> * delay=null, no delay
> * delay=0, no delay
> * delay=-1 or delay=-5000, no delay
> * delay=5000, delay for 5s.
> 
> Correct, this is what I understand too.
> 
> On Fri, Nov 2, 2018 at 9:51 AM jun liu <ke...@gmail.com>> wrote:
>> To conclude, Dubbo should start to expose services until spring context
>> gets refreshed, no matter delay or no-delay is configured.
> 
> +1, agree with this logic as the default for the export process.
> 
>> Unfortunately in
>> order to keep backward compatibility, considering not all spring versions
>> support context refresh callback, we have to start to expose services after
>> properties set if we find application listener is not supported, and hope
>> Dubbo service can be exposed normally.
> 
> At first, I tend to remove the compatibility purpose snippet, because spring versions without application listener support seems to be v2.0.0 or earlier which must have been announced EOL long ago and may have few users. But since the critical export process will never be triggered if removed, I think it’s ok to continue keep it.
> 
> To make sure I understand the change affect right, is the following and the corresponding action right (for spring supports application listener)?
> 
> Export always being executed after Spring Context initialized properly despite the delay value, and the delay times after that is:
> * delay=null, no delay
> * delay=0, no delay
> * delay=-1 or delay=-5000, no delay
> * delay=5000, delay for 5s.
> 
> Best regards,
> Jun
> 
>> On Nov 1, 2018, at 10:39 AM, Ian Luo <ia...@gmail.com>> wrote:
>> 
>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>> 
>> I think this behavior is expected. The reason is, the best timing for Dubbo
>> to count down delay for exposing service is when Spring container is ready,
>> then this timing should be the moment when spring context gets refreshed,
>> since at this moment, all beans are settled, and are ready for wiring in
>> their dependencies. If it happens earlier, say, at the moment after
>> properties set, then Dubbo may fail to expose service because it depends on
>> other spring bean.
>> 
>> To conclude, Dubbo should start to expose services until spring context
>> gets refreshed, no matter delay or no-delay is configured. Unfortunately in
>> order to keep backward compatibility, considering not all spring versions
>> support context refresh callback, we have to start to expose services after
>> properties set if we find application listener is not supported, and hope
>> Dubbo service can be exposed normally.
>> 
>> I hope this can clarify the behavior.
>> 
>> -Ian.
>> 
>> 
>> 
>> On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yi...@apache.org>> wrote:
>> 
>>> Hi,
>>> 
>>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
>>> export 暴露服务
>>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>>> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
>>> 
>>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>> 
>>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>>> 
>>> Yes, you are right.
>>> 
>>> yiji
>>> 
>>> 田 小波 <ti...@outlook.com>> 于2018年11月1日周四 上午1:25写道:
>>> 
>>>> Hi,
>>>> 
>>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>>> 
>>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
>>>> export 暴露服务
>>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>>>> 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
>>>> 
>>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>>> 
>>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>>>> 
>>>> - xiaobo
>>>> 
>>>> 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org>> 写道:
>>>> 
>>>> Hi,
>>>> 
>>>> 我认为这种修改会造成延迟暴露的bug。
>>>> 如果要在容器启动10秒后才进行服务暴露怎么办?
>>>> 原始意图delay= 10000表示10秒后执行。
>>>> 
>>>> I think this modification will cause a delay in the exposure of the bug.
>>>> What if you want to expose the service 10 seconds after the spring
>>>> container started ?
>>>> The original intention delay = 10000 represents execution after 10
>>>> seconds.
>>>> 
>>>> public synchronized void export() {
>>>>   if (delay != null && delay > 0) {
>>>>      // should be delay, eg: 1 seconds
>>>>       delayExportExecutor.schedule(new Runnable() {
>>>>           @Override
>>>>           public void run() {
>>>>               doExport();
>>>>           }
>>>>       }, delay, TimeUnit.MILLISECONDS);
>>>>   } else {
>>>>       doExport();
>>>>   }
>>>> }
>>>> 
>>>> yiji
>>>> 
>>>> Ian Luo <ia...@gmail.com>> 于2018年10月31日周三 下午5:50写道:
>>>> 
>>>>> good good study, day day up. Looking forward to your contribution :)
>>>>> 
>>>>> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com>>
>>> wrote:
>>>>> 
>>>>>> Yes, in fact, It is a plan. I'm learning Dubbo code by writing blogs
>>>>> way,
>>>>>> It can make me understand Dubbo code deeply. So, I need to finish my
>>>>> blogs
>>>>>> first before doing other thing.
>>>>>> 
>>>>>> 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com>> 写道:
>>>>>> 
>>>>>> sounds like a plan :)
>>>>>> 
>>>>>> Thanks,
>>>>>> -Ian.
>>>>>> 
>>>>>> On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com>>
>>>>> wrote:
>>>>>> 
>>>>>>> OK. I will read these articles carefully and think about how to
>>> enhance
>>>>>>> them next month or later. Please wait.
>>>>>>> 
>>>>>>> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com>> 写道:
>>>>>>> 
>>>>>>> Excellent post. You may consider to enhance
>>>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
>>> and
>>>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
>>>>>>> 
>>>>>>> -Ian.
>>>>>>> 
>>>>>>> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <ti...@outlook.com>>
>>>>> wrote:
>>>>>>> 
>>>>>>>> Luo Ian:
>>>>>>>> 
>>>>>>>> I will contribute more for Dubbo community in the future. I'm going
>>> to
>>>>>>>> submit a new PR to dubbo-website after my Dubbo blogs are finished.
>>> I
>>>>> am
>>>>>>>> now hastening to write blogs, and two blogs has bean finished. I
>>> will
>>>>>>>> finish remaining blogs next month. The first blog "Dubbo 源码分析 - SPI
>>> 机制
>>>>>>>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
>>> published
>>>>>>>> on cnblogs.com<http://cnblogs.com/>. You may read it and give me some guidance if you
>>> have
>>>>>>>> interest and time, thanks.
>>>>>>>> 
>>>>>>>> Best wishes,
>>>>>>>> -xiaobo.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com>> 写道:
>>>>>>>> 
>>>>>>>> XiaoBo,
>>>>>>>> 
>>>>>>>> Nice! Pls. consider contributing more to the community in the
>>> future.
>>>>>>>> 
>>>>>>>> Recently, I have bean writing a series of blogs about Dubbo
>>>>>>>> 
>>>>>>>> Pls. share the link with the community (send email to
>>>>>>>> dev@dubbo.apache.org<ma...@dubbo.apache.org>) once you finish :) You can also consider to
>>>>> post
>>>>>>>> your article to Dubbo's website [1]. It will become another pull
>>>>> request
>>>>>>>> from you by the way :)
>>>>>>>> 
>>>>>>>> Thanks,
>>>>>>>> -Ian.
>>>>>>>> 
>>>>>>>> 1. https://github.com/apache/incubator-dubbo-website
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com>>
>>>>> wrote:
>>>>>>>> 
>>>>>>>>> Luo lan:
>>>>>>>>>   Thanks to merge my PR. It is my first PR, I feel very exciting.
>>>>>>>>> Recently, I have bean writing a series of blogs about Dubbo. And, I
>>>>> expect
>>>>>>>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
>>>>> popularity.
>>>>>>>>>   Best wishes.
>>>>>>>>> 
>>>>>>>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com>> 写道:
>>>>>>>>> 
>>>>>>>>> Xiaobo,
>>>>>>>>> 
>>>>>>>>> I notice that you've already updated pull request. Now the change
>>>>> looks
>>>>>>>>> good, and I've merged your pull request.
>>>>>>>>> 
>>>>>>>>> Thanks,
>>>>>>>>> -Ian.
>>>>>>>>> 
>>>>>>>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com>>
>>> wrote:
>>>>>>>>> 
>>>>>>>>>> Xiaobo,
>>>>>>>>>> 
>>>>>>>>>> Would you mind to take a look at the comments I dropped on pull
>>>>>>>>>> request 2686 [1] you proposed? Basically I think we could
>>>>> completely remove
>>>>>>>>>> isDelay method, if you agree with this idea, pls. follow up to
>>>>> enhance your
>>>>>>>>>> pull request.
>>>>>>>>>> 
>>>>>>>>>> Thanks,
>>>>>>>>>> -Ian.
>>>>>>>>>> 
>>>>>>>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
>>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>> 
>>>> 
>>>> 
>>>> 
>>> 
> 
> 


Re: pull request 2686

Posted by 田 小波 <ti...@outlook.com>.
Nice! if needed, May I help to update the doc about delay exposure when PR-2686 is released at next release or later.

在 2018年11月2日,上午10:07,Ian Luo <ia...@gmail.com>> 写道:

To make sure I understand the change affect right, is the following and the corresponding action right (for spring supports application listener)?
Export always being executed after Spring Context initialized properly despite the delay value, and the delay times after that is:
* delay=null, no delay
* delay=0, no delay
* delay=-1 or delay=-5000, no delay
* delay=5000, delay for 5s.

Correct, this is what I understand too.

On Fri, Nov 2, 2018 at 9:51 AM jun liu <ke...@gmail.com>> wrote:
> To conclude, Dubbo should start to expose services until spring context
> gets refreshed, no matter delay or no-delay is configured.

+1, agree with this logic as the default for the export process.

>  Unfortunately in
> order to keep backward compatibility, considering not all spring versions
> support context refresh callback, we have to start to expose services after
> properties set if we find application listener is not supported, and hope
> Dubbo service can be exposed normally.

At first, I tend to remove the compatibility purpose snippet, because spring versions without application listener support seems to be v2.0.0 or earlier which must have been announced EOL long ago and may have few users. But since the critical export process will never be triggered if removed, I think it’s ok to continue keep it.

To make sure I understand the change affect right, is the following and the corresponding action right (for spring supports application listener)?

Export always being executed after Spring Context initialized properly despite the delay value, and the delay times after that is:
* delay=null, no delay
* delay=0, no delay
* delay=-1 or delay=-5000, no delay
* delay=5000, delay for 5s.

Best regards,
Jun

> On Nov 1, 2018, at 10:39 AM, Ian Luo <ia...@gmail.com>> wrote:
>
>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>
> I think this behavior is expected. The reason is, the best timing for Dubbo
> to count down delay for exposing service is when Spring container is ready,
> then this timing should be the moment when spring context gets refreshed,
> since at this moment, all beans are settled, and are ready for wiring in
> their dependencies. If it happens earlier, say, at the moment after
> properties set, then Dubbo may fail to expose service because it depends on
> other spring bean.
>
> To conclude, Dubbo should start to expose services until spring context
> gets refreshed, no matter delay or no-delay is configured. Unfortunately in
> order to keep backward compatibility, considering not all spring versions
> support context refresh callback, we have to start to expose services after
> properties set if we find application listener is not supported, and hope
> Dubbo service can be exposed normally.
>
> I hope this can clarify the behavior.
>
> -Ian.
>
>
>
> On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yi...@apache.org>> wrote:
>
>> Hi,
>>
>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
>> export 暴露服务
>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
>>
>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>
>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>>
>> Yes, you are right.
>>
>> yiji
>>
>> 田 小波 <ti...@outlook.com>> 于2018年11月1日周四 上午1:25写道:
>>
>>> Hi,
>>>
>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>>
>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
>>> export 暴露服务
>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>>> 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
>>>
>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>>
>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>>>
>>> - xiaobo
>>>
>>> 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org>> 写道:
>>>
>>> Hi,
>>>
>>> 我认为这种修改会造成延迟暴露的bug。
>>> 如果要在容器启动10秒后才进行服务暴露怎么办?
>>> 原始意图delay= 10000表示10秒后执行。
>>>
>>> I think this modification will cause a delay in the exposure of the bug.
>>> What if you want to expose the service 10 seconds after the spring
>>> container started ?
>>> The original intention delay = 10000 represents execution after 10
>>> seconds.
>>>
>>> public synchronized void export() {
>>>    if (delay != null && delay > 0) {
>>>       // should be delay, eg: 1 seconds
>>>        delayExportExecutor.schedule(new Runnable() {
>>>            @Override
>>>            public void run() {
>>>                doExport();
>>>            }
>>>        }, delay, TimeUnit.MILLISECONDS);
>>>    } else {
>>>        doExport();
>>>    }
>>> }
>>>
>>> yiji
>>>
>>> Ian Luo <ia...@gmail.com>> 于2018年10月31日周三 下午5:50写道:
>>>
>>>> good good study, day day up. Looking forward to your contribution :)
>>>>
>>>> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com>>
>> wrote:
>>>>
>>>>> Yes, in fact, It is a plan. I'm learning Dubbo code by writing blogs
>>>> way,
>>>>> It can make me understand Dubbo code deeply. So, I need to finish my
>>>> blogs
>>>>> first before doing other thing.
>>>>>
>>>>> 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com>> 写道:
>>>>>
>>>>> sounds like a plan :)
>>>>>
>>>>> Thanks,
>>>>> -Ian.
>>>>>
>>>>> On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com>>
>>>> wrote:
>>>>>
>>>>>> OK. I will read these articles carefully and think about how to
>> enhance
>>>>>> them next month or later. Please wait.
>>>>>>
>>>>>> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com>> 写道:
>>>>>>
>>>>>> Excellent post. You may consider to enhance
>>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
>> and
>>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
>>>>>>
>>>>>> -Ian.
>>>>>>
>>>>>> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <ti...@outlook.com>>
>>>> wrote:
>>>>>>
>>>>>>> Luo Ian:
>>>>>>>
>>>>>>> I will contribute more for Dubbo community in the future. I'm going
>> to
>>>>>>> submit a new PR to dubbo-website after my Dubbo blogs are finished.
>> I
>>>> am
>>>>>>> now hastening to write blogs, and two blogs has bean finished. I
>> will
>>>>>>> finish remaining blogs next month. The first blog "Dubbo 源码分析 - SPI
>> 机制
>>>>>>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
>> published
>>>>>>> on cnblogs.com<http://cnblogs.com/>. You may read it and give me some guidance if you
>> have
>>>>>>> interest and time, thanks.
>>>>>>>
>>>>>>> Best wishes,
>>>>>>> -xiaobo.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com>> 写道:
>>>>>>>
>>>>>>> XiaoBo,
>>>>>>>
>>>>>>> Nice! Pls. consider contributing more to the community in the
>> future.
>>>>>>>
>>>>>>> Recently, I have bean writing a series of blogs about Dubbo
>>>>>>>
>>>>>>> Pls. share the link with the community (send email to
>>>>>>> dev@dubbo.apache.org<ma...@dubbo.apache.org>) once you finish :) You can also consider to
>>>> post
>>>>>>> your article to Dubbo's website [1]. It will become another pull
>>>> request
>>>>>>> from you by the way :)
>>>>>>>
>>>>>>> Thanks,
>>>>>>> -Ian.
>>>>>>>
>>>>>>> 1. https://github.com/apache/incubator-dubbo-website
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com>>
>>>> wrote:
>>>>>>>
>>>>>>>> Luo lan:
>>>>>>>>    Thanks to merge my PR. It is my first PR, I feel very exciting.
>>>>>>>> Recently, I have bean writing a series of blogs about Dubbo. And, I
>>>> expect
>>>>>>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
>>>> popularity.
>>>>>>>>    Best wishes.
>>>>>>>>
>>>>>>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com>> 写道:
>>>>>>>>
>>>>>>>> Xiaobo,
>>>>>>>>
>>>>>>>> I notice that you've already updated pull request. Now the change
>>>> looks
>>>>>>>> good, and I've merged your pull request.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> -Ian.
>>>>>>>>
>>>>>>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com>>
>> wrote:
>>>>>>>>
>>>>>>>>> Xiaobo,
>>>>>>>>>
>>>>>>>>> Would you mind to take a look at the comments I dropped on pull
>>>>>>>>> request 2686 [1] you proposed? Basically I think we could
>>>> completely remove
>>>>>>>>> isDelay method, if you agree with this idea, pls. follow up to
>>>> enhance your
>>>>>>>>> pull request.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> -Ian.
>>>>>>>>>
>>>>>>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>
>>>
>>>
>>



Re: pull request 2686

Posted by Ian Luo <ia...@gmail.com>.
>
> To make sure I understand the change affect right, is the following and
> the corresponding action right (for spring supports application listener)?
> Export always being executed after Spring Context initialized properly
> despite the delay value, and the delay times after that is:
> * delay=null, no delay
> * delay=0, no delay
> * delay=-1 or delay=-5000, no delay
> * delay=5000, delay for 5s.


Correct, this is what I understand too.

On Fri, Nov 2, 2018 at 9:51 AM jun liu <ke...@gmail.com> wrote:

> > To conclude, Dubbo should start to expose services until spring context
> > gets refreshed, no matter delay or no-delay is configured.
>
> +1, agree with this logic as the default for the export process.
>
> >  Unfortunately in
> > order to keep backward compatibility, considering not all spring versions
> > support context refresh callback, we have to start to expose services
> after
> > properties set if we find application listener is not supported, and hope
> > Dubbo service can be exposed normally.
>
> At first, I tend to remove the compatibility purpose snippet, because
> spring versions without application listener support seems to be v2.0.0 or
> earlier which must have been announced EOL long ago and may have few users.
> But since the critical export process will never be triggered if removed, I
> think it’s ok to continue keep it.
>
> To make sure I understand the change affect right, is the following and
> the corresponding action right (for spring supports application listener)?
>
> Export always being executed after Spring Context initialized properly
> despite the delay value, and the delay times after that is:
> * delay=null, no delay
> * delay=0, no delay
> * delay=-1 or delay=-5000, no delay
> * delay=5000, delay for 5s.
>
> Best regards,
> Jun
>
> > On Nov 1, 2018, at 10:39 AM, Ian Luo <ia...@gmail.com> wrote:
> >
> >> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> > supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
> > afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> > 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> >
> > I think this behavior is expected. The reason is, the best timing for
> Dubbo
> > to count down delay for exposing service is when Spring container is
> ready,
> > then this timing should be the moment when spring context gets refreshed,
> > since at this moment, all beans are settled, and are ready for wiring in
> > their dependencies. If it happens earlier, say, at the moment after
> > properties set, then Dubbo may fail to expose service because it depends
> on
> > other spring bean.
> >
> > To conclude, Dubbo should start to expose services until spring context
> > gets refreshed, no matter delay or no-delay is configured. Unfortunately
> in
> > order to keep backward compatibility, considering not all spring versions
> > support context refresh callback, we have to start to expose services
> after
> > properties set if we find application listener is not supported, and hope
> > Dubbo service can be exposed normally.
> >
> > I hope this can clarify the behavior.
> >
> > -Ian.
> >
> >
> >
> > On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yi...@apache.org> wrote:
> >
> >> Hi,
> >>
> >>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> >>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
> >> export 暴露服务
> >>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> >> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
> >>
> >>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> >> supportedApplicationListener = true 时,export 会被 onApplicationEvent
> 调用,而不是
> >> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> >> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> >>
> >>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
> >>
> >> Yes, you are right.
> >>
> >> yiji
> >>
> >> 田 小波 <ti...@outlook.com> 于2018年11月1日周四 上午1:25写道:
> >>
> >>> Hi,
> >>>
> >>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> >>>
> >>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
> >>> export 暴露服务
> >>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> >>> 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
> >>>
> >>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> >>> supportedApplicationListener = true 时,export 会被 onApplicationEvent
> 调用,而不是
> >>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> >>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> >>>
> >>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
> >>>
> >>> - xiaobo
> >>>
> >>> 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org> 写道:
> >>>
> >>> Hi,
> >>>
> >>> 我认为这种修改会造成延迟暴露的bug。
> >>> 如果要在容器启动10秒后才进行服务暴露怎么办?
> >>> 原始意图delay= 10000表示10秒后执行。
> >>>
> >>> I think this modification will cause a delay in the exposure of the
> bug.
> >>> What if you want to expose the service 10 seconds after the spring
> >>> container started ?
> >>> The original intention delay = 10000 represents execution after 10
> >>> seconds.
> >>>
> >>> public synchronized void export() {
> >>>    if (delay != null && delay > 0) {
> >>>       // should be delay, eg: 1 seconds
> >>>        delayExportExecutor.schedule(new Runnable() {
> >>>            @Override
> >>>            public void run() {
> >>>                doExport();
> >>>            }
> >>>        }, delay, TimeUnit.MILLISECONDS);
> >>>    } else {
> >>>        doExport();
> >>>    }
> >>> }
> >>>
> >>> yiji
> >>>
> >>> Ian Luo <ia...@gmail.com> 于2018年10月31日周三 下午5:50写道:
> >>>
> >>>> good good study, day day up. Looking forward to your contribution :)
> >>>>
> >>>> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com>
> >> wrote:
> >>>>
> >>>>> Yes, in fact, It is a plan. I'm learning Dubbo code by writing blogs
> >>>> way,
> >>>>> It can make me understand Dubbo code deeply. So, I need to finish my
> >>>> blogs
> >>>>> first before doing other thing.
> >>>>>
> >>>>> 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com> 写道:
> >>>>>
> >>>>> sounds like a plan :)
> >>>>>
> >>>>> Thanks,
> >>>>> -Ian.
> >>>>>
> >>>>> On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com>
> >>>> wrote:
> >>>>>
> >>>>>> OK. I will read these articles carefully and think about how to
> >> enhance
> >>>>>> them next month or later. Please wait.
> >>>>>>
> >>>>>> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com> 写道:
> >>>>>>
> >>>>>> Excellent post. You may consider to enhance
> >>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
> >> and
> >>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html
> .
> >>>>>>
> >>>>>> -Ian.
> >>>>>>
> >>>>>> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <ti...@outlook.com>
> >>>> wrote:
> >>>>>>
> >>>>>>> Luo Ian:
> >>>>>>>
> >>>>>>> I will contribute more for Dubbo community in the future. I'm going
> >> to
> >>>>>>> submit a new PR to dubbo-website after my Dubbo blogs are finished.
> >> I
> >>>> am
> >>>>>>> now hastening to write blogs, and two blogs has bean finished. I
> >> will
> >>>>>>> finish remaining blogs next month. The first blog "Dubbo 源码分析 - SPI
> >> 机制
> >>>>>>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
> >> published
> >>>>>>> on cnblogs.com. You may read it and give me some guidance if you
> >> have
> >>>>>>> interest and time, thanks.
> >>>>>>>
> >>>>>>> Best wishes,
> >>>>>>> -xiaobo.
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com> 写道:
> >>>>>>>
> >>>>>>> XiaoBo,
> >>>>>>>
> >>>>>>> Nice! Pls. consider contributing more to the community in the
> >> future.
> >>>>>>>
> >>>>>>> Recently, I have bean writing a series of blogs about Dubbo
> >>>>>>>
> >>>>>>> Pls. share the link with the community (send email to
> >>>>>>> dev@dubbo.apache.org) once you finish :) You can also consider to
> >>>> post
> >>>>>>> your article to Dubbo's website [1]. It will become another pull
> >>>> request
> >>>>>>> from you by the way :)
> >>>>>>>
> >>>>>>> Thanks,
> >>>>>>> -Ian.
> >>>>>>>
> >>>>>>> 1. https://github.com/apache/incubator-dubbo-website
> >>>>>>>
> >>>>>>>
> >>>>>>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com>
> >>>> wrote:
> >>>>>>>
> >>>>>>>> Luo lan:
> >>>>>>>>    Thanks to merge my PR. It is my first PR, I feel very exciting.
> >>>>>>>> Recently, I have bean writing a series of blogs about Dubbo. And,
> I
> >>>> expect
> >>>>>>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
> >>>> popularity.
> >>>>>>>>    Best wishes.
> >>>>>>>>
> >>>>>>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com> 写道:
> >>>>>>>>
> >>>>>>>> Xiaobo,
> >>>>>>>>
> >>>>>>>> I notice that you've already updated pull request. Now the change
> >>>> looks
> >>>>>>>> good, and I've merged your pull request.
> >>>>>>>>
> >>>>>>>> Thanks,
> >>>>>>>> -Ian.
> >>>>>>>>
> >>>>>>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com>
> >> wrote:
> >>>>>>>>
> >>>>>>>>> Xiaobo,
> >>>>>>>>>
> >>>>>>>>> Would you mind to take a look at the comments I dropped on pull
> >>>>>>>>> request 2686 [1] you proposed? Basically I think we could
> >>>> completely remove
> >>>>>>>>> isDelay method, if you agree with this idea, pls. follow up to
> >>>> enhance your
> >>>>>>>>> pull request.
> >>>>>>>>>
> >>>>>>>>> Thanks,
> >>>>>>>>> -Ian.
> >>>>>>>>>
> >>>>>>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>
> >>>
> >>>
> >>>
> >>
>
>

Re: pull request 2686

Posted by jun liu <ke...@gmail.com>.
> To conclude, Dubbo should start to expose services until spring context
> gets refreshed, no matter delay or no-delay is configured. 

+1, agree with this logic as the default for the export process. 

>  Unfortunately in
> order to keep backward compatibility, considering not all spring versions
> support context refresh callback, we have to start to expose services after
> properties set if we find application listener is not supported, and hope
> Dubbo service can be exposed normally.

At first, I tend to remove the compatibility purpose snippet, because spring versions without application listener support seems to be v2.0.0 or earlier which must have been announced EOL long ago and may have few users. But since the critical export process will never be triggered if removed, I think it’s ok to continue keep it.

To make sure I understand the change affect right, is the following and the corresponding action right (for spring supports application listener)? 

Export always being executed after Spring Context initialized properly despite the delay value, and the delay times after that is:
* delay=null, no delay
* delay=0, no delay
* delay=-1 or delay=-5000, no delay
* delay=5000, delay for 5s.

Best regards,
Jun

> On Nov 1, 2018, at 10:39 AM, Ian Luo <ia...@gmail.com> wrote:
> 
>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> 
> I think this behavior is expected. The reason is, the best timing for Dubbo
> to count down delay for exposing service is when Spring container is ready,
> then this timing should be the moment when spring context gets refreshed,
> since at this moment, all beans are settled, and are ready for wiring in
> their dependencies. If it happens earlier, say, at the moment after
> properties set, then Dubbo may fail to expose service because it depends on
> other spring bean.
> 
> To conclude, Dubbo should start to expose services until spring context
> gets refreshed, no matter delay or no-delay is configured. Unfortunately in
> order to keep backward compatibility, considering not all spring versions
> support context refresh callback, we have to start to expose services after
> properties set if we find application listener is not supported, and hope
> Dubbo service can be exposed normally.
> 
> I hope this can clarify the behavior.
> 
> -Ian.
> 
> 
> 
> On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yi...@apache.org> wrote:
> 
>> Hi,
>> 
>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
>> export 暴露服务
>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
>> 
>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>> 
>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>> 
>> Yes, you are right.
>> 
>> yiji
>> 
>> 田 小波 <ti...@outlook.com> 于2018年11月1日周四 上午1:25写道:
>> 
>>> Hi,
>>> 
>>> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>> 
>>> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
>>> export 暴露服务
>>> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>>> 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
>>> 
>>> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>> 
>>> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>>> 
>>> - xiaobo
>>> 
>>> 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org> 写道:
>>> 
>>> Hi,
>>> 
>>> 我认为这种修改会造成延迟暴露的bug。
>>> 如果要在容器启动10秒后才进行服务暴露怎么办?
>>> 原始意图delay= 10000表示10秒后执行。
>>> 
>>> I think this modification will cause a delay in the exposure of the bug.
>>> What if you want to expose the service 10 seconds after the spring
>>> container started ?
>>> The original intention delay = 10000 represents execution after 10
>>> seconds.
>>> 
>>> public synchronized void export() {
>>>    if (delay != null && delay > 0) {
>>>       // should be delay, eg: 1 seconds
>>>        delayExportExecutor.schedule(new Runnable() {
>>>            @Override
>>>            public void run() {
>>>                doExport();
>>>            }
>>>        }, delay, TimeUnit.MILLISECONDS);
>>>    } else {
>>>        doExport();
>>>    }
>>> }
>>> 
>>> yiji
>>> 
>>> Ian Luo <ia...@gmail.com> 于2018年10月31日周三 下午5:50写道:
>>> 
>>>> good good study, day day up. Looking forward to your contribution :)
>>>> 
>>>> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com>
>> wrote:
>>>> 
>>>>> Yes, in fact, It is a plan. I'm learning Dubbo code by writing blogs
>>>> way,
>>>>> It can make me understand Dubbo code deeply. So, I need to finish my
>>>> blogs
>>>>> first before doing other thing.
>>>>> 
>>>>> 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com> 写道:
>>>>> 
>>>>> sounds like a plan :)
>>>>> 
>>>>> Thanks,
>>>>> -Ian.
>>>>> 
>>>>> On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com>
>>>> wrote:
>>>>> 
>>>>>> OK. I will read these articles carefully and think about how to
>> enhance
>>>>>> them next month or later. Please wait.
>>>>>> 
>>>>>> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com> 写道:
>>>>>> 
>>>>>> Excellent post. You may consider to enhance
>>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
>> and
>>>>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
>>>>>> 
>>>>>> -Ian.
>>>>>> 
>>>>>> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <ti...@outlook.com>
>>>> wrote:
>>>>>> 
>>>>>>> Luo Ian:
>>>>>>> 
>>>>>>> I will contribute more for Dubbo community in the future. I'm going
>> to
>>>>>>> submit a new PR to dubbo-website after my Dubbo blogs are finished.
>> I
>>>> am
>>>>>>> now hastening to write blogs, and two blogs has bean finished. I
>> will
>>>>>>> finish remaining blogs next month. The first blog "Dubbo 源码分析 - SPI
>> 机制
>>>>>>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
>> published
>>>>>>> on cnblogs.com. You may read it and give me some guidance if you
>> have
>>>>>>> interest and time, thanks.
>>>>>>> 
>>>>>>> Best wishes,
>>>>>>> -xiaobo.
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com> 写道:
>>>>>>> 
>>>>>>> XiaoBo,
>>>>>>> 
>>>>>>> Nice! Pls. consider contributing more to the community in the
>> future.
>>>>>>> 
>>>>>>> Recently, I have bean writing a series of blogs about Dubbo
>>>>>>> 
>>>>>>> Pls. share the link with the community (send email to
>>>>>>> dev@dubbo.apache.org) once you finish :) You can also consider to
>>>> post
>>>>>>> your article to Dubbo's website [1]. It will become another pull
>>>> request
>>>>>>> from you by the way :)
>>>>>>> 
>>>>>>> Thanks,
>>>>>>> -Ian.
>>>>>>> 
>>>>>>> 1. https://github.com/apache/incubator-dubbo-website
>>>>>>> 
>>>>>>> 
>>>>>>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com>
>>>> wrote:
>>>>>>> 
>>>>>>>> Luo lan:
>>>>>>>>    Thanks to merge my PR. It is my first PR, I feel very exciting.
>>>>>>>> Recently, I have bean writing a series of blogs about Dubbo. And, I
>>>> expect
>>>>>>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
>>>> popularity.
>>>>>>>>    Best wishes.
>>>>>>>> 
>>>>>>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com> 写道:
>>>>>>>> 
>>>>>>>> Xiaobo,
>>>>>>>> 
>>>>>>>> I notice that you've already updated pull request. Now the change
>>>> looks
>>>>>>>> good, and I've merged your pull request.
>>>>>>>> 
>>>>>>>> Thanks,
>>>>>>>> -Ian.
>>>>>>>> 
>>>>>>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com>
>> wrote:
>>>>>>>> 
>>>>>>>>> Xiaobo,
>>>>>>>>> 
>>>>>>>>> Would you mind to take a look at the comments I dropped on pull
>>>>>>>>> request 2686 [1] you proposed? Basically I think we could
>>>> completely remove
>>>>>>>>> isDelay method, if you agree with this idea, pls. follow up to
>>>> enhance your
>>>>>>>>> pull request.
>>>>>>>>> 
>>>>>>>>> Thanks,
>>>>>>>>> -Ian.
>>>>>>>>> 
>>>>>>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
>>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>> 
>>> 
>>> 
>>> 
>> 


Re: pull request 2686

Posted by Zonghai Shang <yi...@apache.org>.
:-)  My understanding is wrong, and keeping the delayed exposure was what I
expected.

yiji

Ian Luo <ia...@gmail.com> 于2018年11月1日周四 下午1:23写道:

> I cannot agree with it. This code is necessary for delay expose.
>
> On Thu, Nov 1, 2018 at 12:01 PM Zonghai Shang <yi...@apache.org> wrote:
>
> > Hi,
> >
> > org.apache.dubbo.config.ServiceConfig#export :
> >
> > ```
> >
> > if (delay != null && delay > 0) {
> >     delayExportExecutor.schedule(new Runnable() {
> >         @Override
> >         public void run() {
> >             doExport();
> >         }
> >     }, delay, TimeUnit.MILLISECONDS);
> > }
> >
> > ```
> >
> > If compatibility is not a consideration, this code is appropriate to
> delete
> >
> > -yiji
> >
> > Ian Luo <ia...@gmail.com> 于2018年11月1日周四 上午11:48写道:
> >
> > > Folks, pls. also shine your thought on this particular topic.
> > >
> > > Thanks,
> > > -Ian.
> > >
> > > On Thu, Nov 1, 2018 at 11:16 AM 田 小波 <ti...@outlook.com>
> wrote:
> > >
> > > > Last night, I thought deeply the timing of Dubbo expose service. And
> I
> > > > also think It is more reasonable to expose service after Spring
> ready.
> > > >
> > > > -xiaobo
> > > >
> > > > 在 2018年11月1日,上午11:12,Ian Luo <ia...@gmail.com> 写道:
> > > >
> > > > pls. always loop in dev@dubbo.apache.org to discuss :)
> > > >
> > > > On Thu, Nov 1, 2018 at 11:07 AM 田 小波 <ti...@outlook.com>
> > wrote:
> > > >
> > > >> Last night, I thought deeply the timing of Dubbo expose service. I
> > think
> > > >> It is more reasonable to expose service after Spring ready.
> > > >>
> > > >> -xiaobo
> > > >>
> > > >> 在 2018年11月1日,上午10:39,Ian Luo <ia...@gmail.com> 写道:
> > > >>
> > > >> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> > > >> supportedApplicationListener = true 时,export 会被 onApplicationEvent
> > > 调用,而不是
> > > >> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> > > >> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> > > >>
> > > >> I think this behavior is expected. The reason is, the best timing
> for
> > > >> Dubbo to count down delay for exposing service is when Spring
> > container
> > > is
> > > >> ready, then this timing should be the moment when spring context
> gets
> > > >> refreshed, since at this moment, all beans are settled, and are
> ready
> > > for
> > > >> wiring in their dependencies. If it happens earlier, say, at the
> > moment
> > > >> after properties set, then Dubbo may fail to expose service because
> it
> > > >> depends on other spring bean.
> > > >>
> > > >> To conclude, Dubbo should start to expose services until spring
> > context
> > > >> gets refreshed, no matter delay or no-delay is configured.
> > > Unfortunately in
> > > >> order to keep backward compatibility, considering not all spring
> > > versions
> > > >> support context refresh callback, we have to start to expose
> services
> > > after
> > > >> properties set if we find application listener is not supported, and
> > > hope
> > > >> Dubbo service can be exposed normally.
> > > >>
> > > >> I hope this can clarify the behavior.
> > > >>
> > > >> -Ian.
> > > >>
> > > >>
> > > >>
> > > >> On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yi...@apache.org>
> > wrote:
> > > >>
> > > >>> Hi,
> > > >>>
> > > >>> > 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> > > >>> > delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由
> > onApplicationEvent
> > > 调用
> > > >>> export 暴露服务
> > > >>> > delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> > > >>> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
> > > >>>
> > > >>> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> > > >>> supportedApplicationListener = true 时,export 会被 onApplicationEvent
> > > 调用,而不是
> > > >>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> > > >>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> > > >>>
> > > >>> > 这是我目前所发现的问题,不知道和你说的是不是同一个。
> > > >>>
> > > >>> Yes, you are right.
> > > >>>
> > > >>> yiji
> > > >>>
> > > >>> 田 小波 <ti...@outlook.com> 于2018年11月1日周四 上午1:25写道:
> > > >>>
> > > >>> > Hi,
> > > >>> >
> > > >>> > 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> > > >>> >
> > > >>> > delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由
> > onApplicationEvent
> > > 调用
> > > >>> > export 暴露服务
> > > >>> > delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> > > >>> > 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
> > > >>> >
> > > >>> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> > > >>> > supportedApplicationListener = true 时,export 会被
> onApplicationEvent
> > > >>> 调用,而不是
> > > >>> > afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> > > >>> > 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> > > >>> >
> > > >>> > 这是我目前所发现的问题,不知道和你说的是不是同一个。
> > > >>> >
> > > >>> > - xiaobo
> > > >>> >
> > > >>> > 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org> 写道:
> > > >>> >
> > > >>> > Hi,
> > > >>> >
> > > >>> > 我认为这种修改会造成延迟暴露的bug。
> > > >>> > 如果要在容器启动10秒后才进行服务暴露怎么办?
> > > >>> > 原始意图delay= 10000表示10秒后执行。
> > > >>> >
> > > >>> > I think this modification will cause a delay in the exposure of
> the
> > > >>> bug.
> > > >>> > What if you want to expose the service 10 seconds after the
> spring
> > > >>> > container started ?
> > > >>> > The original intention delay = 10000 represents execution after
> 10
> > > >>> > seconds.
> > > >>> >
> > > >>> > public synchronized void export() {
> > > >>> >     if (delay != null && delay > 0) {
> > > >>> >        // should be delay, eg: 1 seconds
> > > >>> >         delayExportExecutor.schedule(new Runnable() {
> > > >>> >             @Override
> > > >>> >             public void run() {
> > > >>> >                 doExport();
> > > >>> >             }
> > > >>> >         }, delay, TimeUnit.MILLISECONDS);
> > > >>> >     } else {
> > > >>> >         doExport();
> > > >>> >     }
> > > >>> > }
> > > >>> >
> > > >>> > yiji
> > > >>> >
> > > >>> > Ian Luo <ia...@gmail.com> 于2018年10月31日周三 下午5:50写道:
> > > >>> >
> > > >>> >> good good study, day day up. Looking forward to your
> contribution
> > :)
> > > >>> >>
> > > >>> >> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <
> tianxiaobo.com@outlook.com>
> > > >>> wrote:
> > > >>> >>
> > > >>> >> > Yes, in fact, It is a plan. I'm learning Dubbo code by writing
> > > blogs
> > > >>> >> way,
> > > >>> >> > It can make me understand Dubbo code deeply. So, I need to
> > finish
> > > my
> > > >>> >> blogs
> > > >>> >> > first before doing other thing.
> > > >>> >> >
> > > >>> >> > 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com> 写道:
> > > >>> >> >
> > > >>> >> > sounds like a plan :)
> > > >>> >> >
> > > >>> >> > Thanks,
> > > >>> >> > -Ian.
> > > >>> >> >
> > > >>> >> > On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <
> > tianxiaobo.com@outlook.com>
> > > >>> >> wrote:
> > > >>> >> >
> > > >>> >> >> OK. I will read these articles carefully and think about how
> to
> > > >>> enhance
> > > >>> >> >> them next month or later. Please wait.
> > > >>> >> >>
> > > >>> >> >> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com> 写道:
> > > >>> >> >>
> > > >>> >> >> Excellent post. You may consider to enhance
> > > >>> >> >>
> > > http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
> > > >>> and
> > > >>> >> >>
> > > >>>
> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
> > > >>> >> >>
> > > >>> >> >> -Ian.
> > > >>> >> >>
> > > >>> >> >> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <
> > tianxiaobo.com@outlook.com
> > > >
> > > >>> >> wrote:
> > > >>> >> >>
> > > >>> >> >>> Luo Ian:
> > > >>> >> >>>
> > > >>> >> >>> I will contribute more for Dubbo community in the future.
> I'm
> > > >>> going to
> > > >>> >> >>> submit a new PR to dubbo-website after my Dubbo blogs are
> > > >>> finished. I
> > > >>> >> am
> > > >>> >> >>> now hastening to write blogs, and two blogs has bean
> > finished. I
> > > >>> will
> > > >>> >> >>> finish remaining blogs next month. The first blog "Dubbo
> 源码分析
> > -
> > > >>> SPI 机制
> > > >>> >> >>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
> > > >>> published
> > > >>> >> >>> on cnblogs.com. You may read it and give me some guidance
> if
> > > you
> > > >>> have
> > > >>> >> >>> interest and time, thanks.
> > > >>> >> >>>
> > > >>> >> >>> Best wishes,
> > > >>> >> >>> -xiaobo.
> > > >>> >> >>>
> > > >>> >> >>>
> > > >>> >> >>>
> > > >>> >> >>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com> 写道:
> > > >>> >> >>>
> > > >>> >> >>> XiaoBo,
> > > >>> >> >>>
> > > >>> >> >>> Nice! Pls. consider contributing more to the community in
> the
> > > >>> future.
> > > >>> >> >>>
> > > >>> >> >>> Recently, I have bean writing a series of blogs about Dubbo
> > > >>> >> >>>
> > > >>> >> >>> Pls. share the link with the community (send email to
> > > >>> >> >>> dev@dubbo.apache.org) once you finish :) You can also
> > consider
> > > to
> > > >>> >> post
> > > >>> >> >>> your article to Dubbo's website [1]. It will become another
> > pull
> > > >>> >> request
> > > >>> >> >>> from you by the way :)
> > > >>> >> >>>
> > > >>> >> >>> Thanks,
> > > >>> >> >>> -Ian.
> > > >>> >> >>>
> > > >>> >> >>> 1. https://github.com/apache/incubator-dubbo-website
> > > >>> >> >>>
> > > >>> >> >>>
> > > >>> >> >>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <
> > > tianxiaobo.com@outlook.com>
> > > >>> >> wrote:
> > > >>> >> >>>
> > > >>> >> >>>> Luo lan:
> > > >>> >> >>>>     Thanks to merge my PR. It is my first PR, I feel very
> > > >>> exciting.
> > > >>> >> >>>> Recently, I have bean writing a series of blogs about
> Dubbo.
> > > >>> And, I
> > > >>> >> expect
> > > >>> >> >>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
> > > >>> >> popularity.
> > > >>> >> >>>>     Best wishes.
> > > >>> >> >>>>
> > > >>> >> >>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com> 写道:
> > > >>> >> >>>>
> > > >>> >> >>>> Xiaobo,
> > > >>> >> >>>>
> > > >>> >> >>>> I notice that you've already updated pull request. Now the
> > > change
> > > >>> >> looks
> > > >>> >> >>>> good, and I've merged your pull request.
> > > >>> >> >>>>
> > > >>> >> >>>> Thanks,
> > > >>> >> >>>> -Ian.
> > > >>> >> >>>>
> > > >>> >> >>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <
> ian.luo@gmail.com>
> > > >>> wrote:
> > > >>> >> >>>>
> > > >>> >> >>>>> Xiaobo,
> > > >>> >> >>>>>
> > > >>> >> >>>>> Would you mind to take a look at the comments I dropped on
> > > pull
> > > >>> >> >>>>> request 2686 [1] you proposed? Basically I think we could
> > > >>> >> completely remove
> > > >>> >> >>>>> isDelay method, if you agree with this idea, pls. follow
> up
> > to
> > > >>> >> enhance your
> > > >>> >> >>>>> pull request.
> > > >>> >> >>>>>
> > > >>> >> >>>>> Thanks,
> > > >>> >> >>>>> -Ian.
> > > >>> >> >>>>>
> > > >>> >> >>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
> > > >>> >> >>>>>
> > > >>> >> >>>>
> > > >>> >> >>>>
> > > >>> >> >>>
> > > >>> >> >>
> > > >>> >> >
> > > >>> >
> > > >>> >
> > > >>> >
> > > >>>
> > > >>
> > > >>
> > > >
> > >
> >
>

Re: pull request 2686

Posted by Ian Luo <ia...@gmail.com>.
I cannot agree with it. This code is necessary for delay expose.

On Thu, Nov 1, 2018 at 12:01 PM Zonghai Shang <yi...@apache.org> wrote:

> Hi,
>
> org.apache.dubbo.config.ServiceConfig#export :
>
> ```
>
> if (delay != null && delay > 0) {
>     delayExportExecutor.schedule(new Runnable() {
>         @Override
>         public void run() {
>             doExport();
>         }
>     }, delay, TimeUnit.MILLISECONDS);
> }
>
> ```
>
> If compatibility is not a consideration, this code is appropriate to delete
>
> -yiji
>
> Ian Luo <ia...@gmail.com> 于2018年11月1日周四 上午11:48写道:
>
> > Folks, pls. also shine your thought on this particular topic.
> >
> > Thanks,
> > -Ian.
> >
> > On Thu, Nov 1, 2018 at 11:16 AM 田 小波 <ti...@outlook.com> wrote:
> >
> > > Last night, I thought deeply the timing of Dubbo expose service. And I
> > > also think It is more reasonable to expose service after Spring ready.
> > >
> > > -xiaobo
> > >
> > > 在 2018年11月1日,上午11:12,Ian Luo <ia...@gmail.com> 写道:
> > >
> > > pls. always loop in dev@dubbo.apache.org to discuss :)
> > >
> > > On Thu, Nov 1, 2018 at 11:07 AM 田 小波 <ti...@outlook.com>
> wrote:
> > >
> > >> Last night, I thought deeply the timing of Dubbo expose service. I
> think
> > >> It is more reasonable to expose service after Spring ready.
> > >>
> > >> -xiaobo
> > >>
> > >> 在 2018年11月1日,上午10:39,Ian Luo <ia...@gmail.com> 写道:
> > >>
> > >> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> > >> supportedApplicationListener = true 时,export 会被 onApplicationEvent
> > 调用,而不是
> > >> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> > >> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> > >>
> > >> I think this behavior is expected. The reason is, the best timing for
> > >> Dubbo to count down delay for exposing service is when Spring
> container
> > is
> > >> ready, then this timing should be the moment when spring context gets
> > >> refreshed, since at this moment, all beans are settled, and are ready
> > for
> > >> wiring in their dependencies. If it happens earlier, say, at the
> moment
> > >> after properties set, then Dubbo may fail to expose service because it
> > >> depends on other spring bean.
> > >>
> > >> To conclude, Dubbo should start to expose services until spring
> context
> > >> gets refreshed, no matter delay or no-delay is configured.
> > Unfortunately in
> > >> order to keep backward compatibility, considering not all spring
> > versions
> > >> support context refresh callback, we have to start to expose services
> > after
> > >> properties set if we find application listener is not supported, and
> > hope
> > >> Dubbo service can be exposed normally.
> > >>
> > >> I hope this can clarify the behavior.
> > >>
> > >> -Ian.
> > >>
> > >>
> > >>
> > >> On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yi...@apache.org>
> wrote:
> > >>
> > >>> Hi,
> > >>>
> > >>> > 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> > >>> > delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由
> onApplicationEvent
> > 调用
> > >>> export 暴露服务
> > >>> > delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> > >>> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
> > >>>
> > >>> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> > >>> supportedApplicationListener = true 时,export 会被 onApplicationEvent
> > 调用,而不是
> > >>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> > >>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> > >>>
> > >>> > 这是我目前所发现的问题,不知道和你说的是不是同一个。
> > >>>
> > >>> Yes, you are right.
> > >>>
> > >>> yiji
> > >>>
> > >>> 田 小波 <ti...@outlook.com> 于2018年11月1日周四 上午1:25写道:
> > >>>
> > >>> > Hi,
> > >>> >
> > >>> > 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> > >>> >
> > >>> > delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由
> onApplicationEvent
> > 调用
> > >>> > export 暴露服务
> > >>> > delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> > >>> > 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
> > >>> >
> > >>> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> > >>> > supportedApplicationListener = true 时,export 会被 onApplicationEvent
> > >>> 调用,而不是
> > >>> > afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> > >>> > 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> > >>> >
> > >>> > 这是我目前所发现的问题,不知道和你说的是不是同一个。
> > >>> >
> > >>> > - xiaobo
> > >>> >
> > >>> > 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org> 写道:
> > >>> >
> > >>> > Hi,
> > >>> >
> > >>> > 我认为这种修改会造成延迟暴露的bug。
> > >>> > 如果要在容器启动10秒后才进行服务暴露怎么办?
> > >>> > 原始意图delay= 10000表示10秒后执行。
> > >>> >
> > >>> > I think this modification will cause a delay in the exposure of the
> > >>> bug.
> > >>> > What if you want to expose the service 10 seconds after the spring
> > >>> > container started ?
> > >>> > The original intention delay = 10000 represents execution after 10
> > >>> > seconds.
> > >>> >
> > >>> > public synchronized void export() {
> > >>> >     if (delay != null && delay > 0) {
> > >>> >        // should be delay, eg: 1 seconds
> > >>> >         delayExportExecutor.schedule(new Runnable() {
> > >>> >             @Override
> > >>> >             public void run() {
> > >>> >                 doExport();
> > >>> >             }
> > >>> >         }, delay, TimeUnit.MILLISECONDS);
> > >>> >     } else {
> > >>> >         doExport();
> > >>> >     }
> > >>> > }
> > >>> >
> > >>> > yiji
> > >>> >
> > >>> > Ian Luo <ia...@gmail.com> 于2018年10月31日周三 下午5:50写道:
> > >>> >
> > >>> >> good good study, day day up. Looking forward to your contribution
> :)
> > >>> >>
> > >>> >> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com>
> > >>> wrote:
> > >>> >>
> > >>> >> > Yes, in fact, It is a plan. I'm learning Dubbo code by writing
> > blogs
> > >>> >> way,
> > >>> >> > It can make me understand Dubbo code deeply. So, I need to
> finish
> > my
> > >>> >> blogs
> > >>> >> > first before doing other thing.
> > >>> >> >
> > >>> >> > 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com> 写道:
> > >>> >> >
> > >>> >> > sounds like a plan :)
> > >>> >> >
> > >>> >> > Thanks,
> > >>> >> > -Ian.
> > >>> >> >
> > >>> >> > On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <
> tianxiaobo.com@outlook.com>
> > >>> >> wrote:
> > >>> >> >
> > >>> >> >> OK. I will read these articles carefully and think about how to
> > >>> enhance
> > >>> >> >> them next month or later. Please wait.
> > >>> >> >>
> > >>> >> >> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com> 写道:
> > >>> >> >>
> > >>> >> >> Excellent post. You may consider to enhance
> > >>> >> >>
> > http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
> > >>> and
> > >>> >> >>
> > >>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
> > >>> >> >>
> > >>> >> >> -Ian.
> > >>> >> >>
> > >>> >> >> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <
> tianxiaobo.com@outlook.com
> > >
> > >>> >> wrote:
> > >>> >> >>
> > >>> >> >>> Luo Ian:
> > >>> >> >>>
> > >>> >> >>> I will contribute more for Dubbo community in the future. I'm
> > >>> going to
> > >>> >> >>> submit a new PR to dubbo-website after my Dubbo blogs are
> > >>> finished. I
> > >>> >> am
> > >>> >> >>> now hastening to write blogs, and two blogs has bean
> finished. I
> > >>> will
> > >>> >> >>> finish remaining blogs next month. The first blog "Dubbo 源码分析
> -
> > >>> SPI 机制
> > >>> >> >>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
> > >>> published
> > >>> >> >>> on cnblogs.com. You may read it and give me some guidance if
> > you
> > >>> have
> > >>> >> >>> interest and time, thanks.
> > >>> >> >>>
> > >>> >> >>> Best wishes,
> > >>> >> >>> -xiaobo.
> > >>> >> >>>
> > >>> >> >>>
> > >>> >> >>>
> > >>> >> >>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com> 写道:
> > >>> >> >>>
> > >>> >> >>> XiaoBo,
> > >>> >> >>>
> > >>> >> >>> Nice! Pls. consider contributing more to the community in the
> > >>> future.
> > >>> >> >>>
> > >>> >> >>> Recently, I have bean writing a series of blogs about Dubbo
> > >>> >> >>>
> > >>> >> >>> Pls. share the link with the community (send email to
> > >>> >> >>> dev@dubbo.apache.org) once you finish :) You can also
> consider
> > to
> > >>> >> post
> > >>> >> >>> your article to Dubbo's website [1]. It will become another
> pull
> > >>> >> request
> > >>> >> >>> from you by the way :)
> > >>> >> >>>
> > >>> >> >>> Thanks,
> > >>> >> >>> -Ian.
> > >>> >> >>>
> > >>> >> >>> 1. https://github.com/apache/incubator-dubbo-website
> > >>> >> >>>
> > >>> >> >>>
> > >>> >> >>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <
> > tianxiaobo.com@outlook.com>
> > >>> >> wrote:
> > >>> >> >>>
> > >>> >> >>>> Luo lan:
> > >>> >> >>>>     Thanks to merge my PR. It is my first PR, I feel very
> > >>> exciting.
> > >>> >> >>>> Recently, I have bean writing a series of blogs about Dubbo.
> > >>> And, I
> > >>> >> expect
> > >>> >> >>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
> > >>> >> popularity.
> > >>> >> >>>>     Best wishes.
> > >>> >> >>>>
> > >>> >> >>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com> 写道:
> > >>> >> >>>>
> > >>> >> >>>> Xiaobo,
> > >>> >> >>>>
> > >>> >> >>>> I notice that you've already updated pull request. Now the
> > change
> > >>> >> looks
> > >>> >> >>>> good, and I've merged your pull request.
> > >>> >> >>>>
> > >>> >> >>>> Thanks,
> > >>> >> >>>> -Ian.
> > >>> >> >>>>
> > >>> >> >>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com>
> > >>> wrote:
> > >>> >> >>>>
> > >>> >> >>>>> Xiaobo,
> > >>> >> >>>>>
> > >>> >> >>>>> Would you mind to take a look at the comments I dropped on
> > pull
> > >>> >> >>>>> request 2686 [1] you proposed? Basically I think we could
> > >>> >> completely remove
> > >>> >> >>>>> isDelay method, if you agree with this idea, pls. follow up
> to
> > >>> >> enhance your
> > >>> >> >>>>> pull request.
> > >>> >> >>>>>
> > >>> >> >>>>> Thanks,
> > >>> >> >>>>> -Ian.
> > >>> >> >>>>>
> > >>> >> >>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
> > >>> >> >>>>>
> > >>> >> >>>>
> > >>> >> >>>>
> > >>> >> >>>
> > >>> >> >>
> > >>> >> >
> > >>> >
> > >>> >
> > >>> >
> > >>>
> > >>
> > >>
> > >
> >
>

Re: pull request 2686

Posted by Zonghai Shang <yi...@apache.org>.
Hi,

org.apache.dubbo.config.ServiceConfig#export :

```

if (delay != null && delay > 0) {
    delayExportExecutor.schedule(new Runnable() {
        @Override
        public void run() {
            doExport();
        }
    }, delay, TimeUnit.MILLISECONDS);
}

```

If compatibility is not a consideration, this code is appropriate to delete

-yiji

Ian Luo <ia...@gmail.com> 于2018年11月1日周四 上午11:48写道:

> Folks, pls. also shine your thought on this particular topic.
>
> Thanks,
> -Ian.
>
> On Thu, Nov 1, 2018 at 11:16 AM 田 小波 <ti...@outlook.com> wrote:
>
> > Last night, I thought deeply the timing of Dubbo expose service. And I
> > also think It is more reasonable to expose service after Spring ready.
> >
> > -xiaobo
> >
> > 在 2018年11月1日,上午11:12,Ian Luo <ia...@gmail.com> 写道:
> >
> > pls. always loop in dev@dubbo.apache.org to discuss :)
> >
> > On Thu, Nov 1, 2018 at 11:07 AM 田 小波 <ti...@outlook.com> wrote:
> >
> >> Last night, I thought deeply the timing of Dubbo expose service. I think
> >> It is more reasonable to expose service after Spring ready.
> >>
> >> -xiaobo
> >>
> >> 在 2018年11月1日,上午10:39,Ian Luo <ia...@gmail.com> 写道:
> >>
> >> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> >> supportedApplicationListener = true 时,export 会被 onApplicationEvent
> 调用,而不是
> >> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> >> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> >>
> >> I think this behavior is expected. The reason is, the best timing for
> >> Dubbo to count down delay for exposing service is when Spring container
> is
> >> ready, then this timing should be the moment when spring context gets
> >> refreshed, since at this moment, all beans are settled, and are ready
> for
> >> wiring in their dependencies. If it happens earlier, say, at the moment
> >> after properties set, then Dubbo may fail to expose service because it
> >> depends on other spring bean.
> >>
> >> To conclude, Dubbo should start to expose services until spring context
> >> gets refreshed, no matter delay or no-delay is configured.
> Unfortunately in
> >> order to keep backward compatibility, considering not all spring
> versions
> >> support context refresh callback, we have to start to expose services
> after
> >> properties set if we find application listener is not supported, and
> hope
> >> Dubbo service can be exposed normally.
> >>
> >> I hope this can clarify the behavior.
> >>
> >> -Ian.
> >>
> >>
> >>
> >> On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yi...@apache.org> wrote:
> >>
> >>> Hi,
> >>>
> >>> > 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> >>> > delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent
> 调用
> >>> export 暴露服务
> >>> > delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> >>> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
> >>>
> >>> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> >>> supportedApplicationListener = true 时,export 会被 onApplicationEvent
> 调用,而不是
> >>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> >>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> >>>
> >>> > 这是我目前所发现的问题,不知道和你说的是不是同一个。
> >>>
> >>> Yes, you are right.
> >>>
> >>> yiji
> >>>
> >>> 田 小波 <ti...@outlook.com> 于2018年11月1日周四 上午1:25写道:
> >>>
> >>> > Hi,
> >>> >
> >>> > 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> >>> >
> >>> > delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent
> 调用
> >>> > export 暴露服务
> >>> > delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> >>> > 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
> >>> >
> >>> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> >>> > supportedApplicationListener = true 时,export 会被 onApplicationEvent
> >>> 调用,而不是
> >>> > afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> >>> > 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> >>> >
> >>> > 这是我目前所发现的问题,不知道和你说的是不是同一个。
> >>> >
> >>> > - xiaobo
> >>> >
> >>> > 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org> 写道:
> >>> >
> >>> > Hi,
> >>> >
> >>> > 我认为这种修改会造成延迟暴露的bug。
> >>> > 如果要在容器启动10秒后才进行服务暴露怎么办?
> >>> > 原始意图delay= 10000表示10秒后执行。
> >>> >
> >>> > I think this modification will cause a delay in the exposure of the
> >>> bug.
> >>> > What if you want to expose the service 10 seconds after the spring
> >>> > container started ?
> >>> > The original intention delay = 10000 represents execution after 10
> >>> > seconds.
> >>> >
> >>> > public synchronized void export() {
> >>> >     if (delay != null && delay > 0) {
> >>> >        // should be delay, eg: 1 seconds
> >>> >         delayExportExecutor.schedule(new Runnable() {
> >>> >             @Override
> >>> >             public void run() {
> >>> >                 doExport();
> >>> >             }
> >>> >         }, delay, TimeUnit.MILLISECONDS);
> >>> >     } else {
> >>> >         doExport();
> >>> >     }
> >>> > }
> >>> >
> >>> > yiji
> >>> >
> >>> > Ian Luo <ia...@gmail.com> 于2018年10月31日周三 下午5:50写道:
> >>> >
> >>> >> good good study, day day up. Looking forward to your contribution :)
> >>> >>
> >>> >> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com>
> >>> wrote:
> >>> >>
> >>> >> > Yes, in fact, It is a plan. I'm learning Dubbo code by writing
> blogs
> >>> >> way,
> >>> >> > It can make me understand Dubbo code deeply. So, I need to finish
> my
> >>> >> blogs
> >>> >> > first before doing other thing.
> >>> >> >
> >>> >> > 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com> 写道:
> >>> >> >
> >>> >> > sounds like a plan :)
> >>> >> >
> >>> >> > Thanks,
> >>> >> > -Ian.
> >>> >> >
> >>> >> > On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com>
> >>> >> wrote:
> >>> >> >
> >>> >> >> OK. I will read these articles carefully and think about how to
> >>> enhance
> >>> >> >> them next month or later. Please wait.
> >>> >> >>
> >>> >> >> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com> 写道:
> >>> >> >>
> >>> >> >> Excellent post. You may consider to enhance
> >>> >> >>
> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
> >>> and
> >>> >> >>
> >>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
> >>> >> >>
> >>> >> >> -Ian.
> >>> >> >>
> >>> >> >> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <tianxiaobo.com@outlook.com
> >
> >>> >> wrote:
> >>> >> >>
> >>> >> >>> Luo Ian:
> >>> >> >>>
> >>> >> >>> I will contribute more for Dubbo community in the future. I'm
> >>> going to
> >>> >> >>> submit a new PR to dubbo-website after my Dubbo blogs are
> >>> finished. I
> >>> >> am
> >>> >> >>> now hastening to write blogs, and two blogs has bean finished. I
> >>> will
> >>> >> >>> finish remaining blogs next month. The first blog "Dubbo 源码分析 -
> >>> SPI 机制
> >>> >> >>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
> >>> published
> >>> >> >>> on cnblogs.com. You may read it and give me some guidance if
> you
> >>> have
> >>> >> >>> interest and time, thanks.
> >>> >> >>>
> >>> >> >>> Best wishes,
> >>> >> >>> -xiaobo.
> >>> >> >>>
> >>> >> >>>
> >>> >> >>>
> >>> >> >>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com> 写道:
> >>> >> >>>
> >>> >> >>> XiaoBo,
> >>> >> >>>
> >>> >> >>> Nice! Pls. consider contributing more to the community in the
> >>> future.
> >>> >> >>>
> >>> >> >>> Recently, I have bean writing a series of blogs about Dubbo
> >>> >> >>>
> >>> >> >>> Pls. share the link with the community (send email to
> >>> >> >>> dev@dubbo.apache.org) once you finish :) You can also consider
> to
> >>> >> post
> >>> >> >>> your article to Dubbo's website [1]. It will become another pull
> >>> >> request
> >>> >> >>> from you by the way :)
> >>> >> >>>
> >>> >> >>> Thanks,
> >>> >> >>> -Ian.
> >>> >> >>>
> >>> >> >>> 1. https://github.com/apache/incubator-dubbo-website
> >>> >> >>>
> >>> >> >>>
> >>> >> >>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <
> tianxiaobo.com@outlook.com>
> >>> >> wrote:
> >>> >> >>>
> >>> >> >>>> Luo lan:
> >>> >> >>>>     Thanks to merge my PR. It is my first PR, I feel very
> >>> exciting.
> >>> >> >>>> Recently, I have bean writing a series of blogs about Dubbo.
> >>> And, I
> >>> >> expect
> >>> >> >>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
> >>> >> popularity.
> >>> >> >>>>     Best wishes.
> >>> >> >>>>
> >>> >> >>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com> 写道:
> >>> >> >>>>
> >>> >> >>>> Xiaobo,
> >>> >> >>>>
> >>> >> >>>> I notice that you've already updated pull request. Now the
> change
> >>> >> looks
> >>> >> >>>> good, and I've merged your pull request.
> >>> >> >>>>
> >>> >> >>>> Thanks,
> >>> >> >>>> -Ian.
> >>> >> >>>>
> >>> >> >>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com>
> >>> wrote:
> >>> >> >>>>
> >>> >> >>>>> Xiaobo,
> >>> >> >>>>>
> >>> >> >>>>> Would you mind to take a look at the comments I dropped on
> pull
> >>> >> >>>>> request 2686 [1] you proposed? Basically I think we could
> >>> >> completely remove
> >>> >> >>>>> isDelay method, if you agree with this idea, pls. follow up to
> >>> >> enhance your
> >>> >> >>>>> pull request.
> >>> >> >>>>>
> >>> >> >>>>> Thanks,
> >>> >> >>>>> -Ian.
> >>> >> >>>>>
> >>> >> >>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
> >>> >> >>>>>
> >>> >> >>>>
> >>> >> >>>>
> >>> >> >>>
> >>> >> >>
> >>> >> >
> >>> >
> >>> >
> >>> >
> >>>
> >>
> >>
> >
>

Re: pull request 2686

Posted by Ian Luo <ia...@gmail.com>.
Folks, pls. also shine your thought on this particular topic.

Thanks,
-Ian.

On Thu, Nov 1, 2018 at 11:16 AM 田 小波 <ti...@outlook.com> wrote:

> Last night, I thought deeply the timing of Dubbo expose service. And I
> also think It is more reasonable to expose service after Spring ready.
>
> -xiaobo
>
> 在 2018年11月1日,上午11:12,Ian Luo <ia...@gmail.com> 写道:
>
> pls. always loop in dev@dubbo.apache.org to discuss :)
>
> On Thu, Nov 1, 2018 at 11:07 AM 田 小波 <ti...@outlook.com> wrote:
>
>> Last night, I thought deeply the timing of Dubbo expose service. I think
>> It is more reasonable to expose service after Spring ready.
>>
>> -xiaobo
>>
>> 在 2018年11月1日,上午10:39,Ian Luo <ia...@gmail.com> 写道:
>>
>> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>
>> I think this behavior is expected. The reason is, the best timing for
>> Dubbo to count down delay for exposing service is when Spring container is
>> ready, then this timing should be the moment when spring context gets
>> refreshed, since at this moment, all beans are settled, and are ready for
>> wiring in their dependencies. If it happens earlier, say, at the moment
>> after properties set, then Dubbo may fail to expose service because it
>> depends on other spring bean.
>>
>> To conclude, Dubbo should start to expose services until spring context
>> gets refreshed, no matter delay or no-delay is configured. Unfortunately in
>> order to keep backward compatibility, considering not all spring versions
>> support context refresh callback, we have to start to expose services after
>> properties set if we find application listener is not supported, and hope
>> Dubbo service can be exposed normally.
>>
>> I hope this can clarify the behavior.
>>
>> -Ian.
>>
>>
>>
>> On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yi...@apache.org> wrote:
>>
>>> Hi,
>>>
>>> > 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>> > delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
>>> export 暴露服务
>>> > delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>>> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
>>>
>>> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
>>> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>>
>>> > 这是我目前所发现的问题,不知道和你说的是不是同一个。
>>>
>>> Yes, you are right.
>>>
>>> yiji
>>>
>>> 田 小波 <ti...@outlook.com> 于2018年11月1日周四 上午1:25写道:
>>>
>>> > Hi,
>>> >
>>> > 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>>> >
>>> > delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
>>> > export 暴露服务
>>> > delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
>>> > 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
>>> >
>>> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
>>> > supportedApplicationListener = true 时,export 会被 onApplicationEvent
>>> 调用,而不是
>>> > afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
>>> > 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>>> >
>>> > 这是我目前所发现的问题,不知道和你说的是不是同一个。
>>> >
>>> > - xiaobo
>>> >
>>> > 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org> 写道:
>>> >
>>> > Hi,
>>> >
>>> > 我认为这种修改会造成延迟暴露的bug。
>>> > 如果要在容器启动10秒后才进行服务暴露怎么办?
>>> > 原始意图delay= 10000表示10秒后执行。
>>> >
>>> > I think this modification will cause a delay in the exposure of the
>>> bug.
>>> > What if you want to expose the service 10 seconds after the spring
>>> > container started ?
>>> > The original intention delay = 10000 represents execution after 10
>>> > seconds.
>>> >
>>> > public synchronized void export() {
>>> >     if (delay != null && delay > 0) {
>>> >        // should be delay, eg: 1 seconds
>>> >         delayExportExecutor.schedule(new Runnable() {
>>> >             @Override
>>> >             public void run() {
>>> >                 doExport();
>>> >             }
>>> >         }, delay, TimeUnit.MILLISECONDS);
>>> >     } else {
>>> >         doExport();
>>> >     }
>>> > }
>>> >
>>> > yiji
>>> >
>>> > Ian Luo <ia...@gmail.com> 于2018年10月31日周三 下午5:50写道:
>>> >
>>> >> good good study, day day up. Looking forward to your contribution :)
>>> >>
>>> >> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com>
>>> wrote:
>>> >>
>>> >> > Yes, in fact, It is a plan. I'm learning Dubbo code by writing blogs
>>> >> way,
>>> >> > It can make me understand Dubbo code deeply. So, I need to finish my
>>> >> blogs
>>> >> > first before doing other thing.
>>> >> >
>>> >> > 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com> 写道:
>>> >> >
>>> >> > sounds like a plan :)
>>> >> >
>>> >> > Thanks,
>>> >> > -Ian.
>>> >> >
>>> >> > On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com>
>>> >> wrote:
>>> >> >
>>> >> >> OK. I will read these articles carefully and think about how to
>>> enhance
>>> >> >> them next month or later. Please wait.
>>> >> >>
>>> >> >> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com> 写道:
>>> >> >>
>>> >> >> Excellent post. You may consider to enhance
>>> >> >> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
>>> and
>>> >> >>
>>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
>>> >> >>
>>> >> >> -Ian.
>>> >> >>
>>> >> >> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <ti...@outlook.com>
>>> >> wrote:
>>> >> >>
>>> >> >>> Luo Ian:
>>> >> >>>
>>> >> >>> I will contribute more for Dubbo community in the future. I'm
>>> going to
>>> >> >>> submit a new PR to dubbo-website after my Dubbo blogs are
>>> finished. I
>>> >> am
>>> >> >>> now hastening to write blogs, and two blogs has bean finished. I
>>> will
>>> >> >>> finish remaining blogs next month. The first blog "Dubbo 源码分析 -
>>> SPI 机制
>>> >> >>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
>>> published
>>> >> >>> on cnblogs.com. You may read it and give me some guidance if you
>>> have
>>> >> >>> interest and time, thanks.
>>> >> >>>
>>> >> >>> Best wishes,
>>> >> >>> -xiaobo.
>>> >> >>>
>>> >> >>>
>>> >> >>>
>>> >> >>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com> 写道:
>>> >> >>>
>>> >> >>> XiaoBo,
>>> >> >>>
>>> >> >>> Nice! Pls. consider contributing more to the community in the
>>> future.
>>> >> >>>
>>> >> >>> Recently, I have bean writing a series of blogs about Dubbo
>>> >> >>>
>>> >> >>> Pls. share the link with the community (send email to
>>> >> >>> dev@dubbo.apache.org) once you finish :) You can also consider to
>>> >> post
>>> >> >>> your article to Dubbo's website [1]. It will become another pull
>>> >> request
>>> >> >>> from you by the way :)
>>> >> >>>
>>> >> >>> Thanks,
>>> >> >>> -Ian.
>>> >> >>>
>>> >> >>> 1. https://github.com/apache/incubator-dubbo-website
>>> >> >>>
>>> >> >>>
>>> >> >>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com>
>>> >> wrote:
>>> >> >>>
>>> >> >>>> Luo lan:
>>> >> >>>>     Thanks to merge my PR. It is my first PR, I feel very
>>> exciting.
>>> >> >>>> Recently, I have bean writing a series of blogs about Dubbo.
>>> And, I
>>> >> expect
>>> >> >>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
>>> >> popularity.
>>> >> >>>>     Best wishes.
>>> >> >>>>
>>> >> >>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com> 写道:
>>> >> >>>>
>>> >> >>>> Xiaobo,
>>> >> >>>>
>>> >> >>>> I notice that you've already updated pull request. Now the change
>>> >> looks
>>> >> >>>> good, and I've merged your pull request.
>>> >> >>>>
>>> >> >>>> Thanks,
>>> >> >>>> -Ian.
>>> >> >>>>
>>> >> >>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com>
>>> wrote:
>>> >> >>>>
>>> >> >>>>> Xiaobo,
>>> >> >>>>>
>>> >> >>>>> Would you mind to take a look at the comments I dropped on pull
>>> >> >>>>> request 2686 [1] you proposed? Basically I think we could
>>> >> completely remove
>>> >> >>>>> isDelay method, if you agree with this idea, pls. follow up to
>>> >> enhance your
>>> >> >>>>> pull request.
>>> >> >>>>>
>>> >> >>>>> Thanks,
>>> >> >>>>> -Ian.
>>> >> >>>>>
>>> >> >>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
>>> >> >>>>>
>>> >> >>>>
>>> >> >>>>
>>> >> >>>
>>> >> >>
>>> >> >
>>> >
>>> >
>>> >
>>>
>>
>>
>

Re: pull request 2686

Posted by 田 小波 <ti...@outlook.com>.
Last night, I thought deeply the timing of Dubbo expose service. And I also think It is more reasonable to expose service after Spring ready.

-xiaobo

在 2018年11月1日,上午11:12,Ian Luo <ia...@gmail.com>> 写道:

pls. always loop in dev@dubbo.apache.org<ma...@dubbo.apache.org> to discuss :)

On Thu, Nov 1, 2018 at 11:07 AM 田 小波 <ti...@outlook.com>> wrote:
Last night, I thought deeply the timing of Dubbo expose service. I think It is more reasonable to expose service after Spring ready.

-xiaobo

在 2018年11月1日,上午10:39,Ian Luo <ia...@gmail.com>> 写道:

> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。

I think this behavior is expected. The reason is, the best timing for Dubbo to count down delay for exposing service is when Spring container is ready, then this timing should be the moment when spring context gets refreshed, since at this moment, all beans are settled, and are ready for wiring in their dependencies. If it happens earlier, say, at the moment after properties set, then Dubbo may fail to expose service because it depends on other spring bean.

To conclude, Dubbo should start to expose services until spring context gets refreshed, no matter delay or no-delay is configured. Unfortunately in order to keep backward compatibility, considering not all spring versions support context refresh callback, we have to start to expose services after properties set if we find application listener is not supported, and hope Dubbo service can be exposed normally.

I hope this can clarify the behavior.

-Ian.



On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yi...@apache.org>> wrote:
Hi,

> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
export 暴露服务
> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
时算起,此时由 afterPropertiesSet 调用 export暴露服务

> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。

> 这是我目前所发现的问题,不知道和你说的是不是同一个。

Yes, you are right.

yiji

田 小波 <ti...@outlook.com>> 于2018年11月1日周四 上午1:25写道:

> Hi,
>
> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>
> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
> export 暴露服务
> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
>
> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>
> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>
> - xiaobo
>
> 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org>> 写道:
>
> Hi,
>
> 我认为这种修改会造成延迟暴露的bug。
> 如果要在容器启动10秒后才进行服务暴露怎么办?
> 原始意图delay= 10000表示10秒后执行。
>
> I think this modification will cause a delay in the exposure of the bug.
> What if you want to expose the service 10 seconds after the spring
> container started ?
> The original intention delay = 10000 represents execution after 10
> seconds.
>
> public synchronized void export() {
>     if (delay != null && delay > 0) {
>        // should be delay, eg: 1 seconds
>         delayExportExecutor.schedule(new Runnable() {
>             @Override
>             public void run() {
>                 doExport();
>             }
>         }, delay, TimeUnit.MILLISECONDS);
>     } else {
>         doExport();
>     }
> }
>
> yiji
>
> Ian Luo <ia...@gmail.com>> 于2018年10月31日周三 下午5:50写道:
>
>> good good study, day day up. Looking forward to your contribution :)
>>
>> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com>> wrote:
>>
>> > Yes, in fact, It is a plan. I'm learning Dubbo code by writing blogs
>> way,
>> > It can make me understand Dubbo code deeply. So, I need to finish my
>> blogs
>> > first before doing other thing.
>> >
>> > 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com>> 写道:
>> >
>> > sounds like a plan :)
>> >
>> > Thanks,
>> > -Ian.
>> >
>> > On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com>>
>> wrote:
>> >
>> >> OK. I will read these articles carefully and think about how to enhance
>> >> them next month or later. Please wait.
>> >>
>> >> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com>> 写道:
>> >>
>> >> Excellent post. You may consider to enhance
>> >> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html and
>> >> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
>> >>
>> >> -Ian.
>> >>
>> >> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <ti...@outlook.com>>
>> wrote:
>> >>
>> >>> Luo Ian:
>> >>>
>> >>> I will contribute more for Dubbo community in the future. I'm going to
>> >>> submit a new PR to dubbo-website after my Dubbo blogs are finished. I
>> am
>> >>> now hastening to write blogs, and two blogs has bean finished. I will
>> >>> finish remaining blogs next month. The first blog "Dubbo 源码分析 - SPI 机制
>> >>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean published
>> >>> on cnblogs.com<http://cnblogs.com/>. You may read it and give me some guidance if you have
>> >>> interest and time, thanks.
>> >>>
>> >>> Best wishes,
>> >>> -xiaobo.
>> >>>
>> >>>
>> >>>
>> >>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com>> 写道:
>> >>>
>> >>> XiaoBo,
>> >>>
>> >>> Nice! Pls. consider contributing more to the community in the future.
>> >>>
>> >>> Recently, I have bean writing a series of blogs about Dubbo
>> >>>
>> >>> Pls. share the link with the community (send email to
>> >>> dev@dubbo.apache.org<ma...@dubbo.apache.org>) once you finish :) You can also consider to
>> post
>> >>> your article to Dubbo's website [1]. It will become another pull
>> request
>> >>> from you by the way :)
>> >>>
>> >>> Thanks,
>> >>> -Ian.
>> >>>
>> >>> 1. https://github.com/apache/incubator-dubbo-website
>> >>>
>> >>>
>> >>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com>>
>> wrote:
>> >>>
>> >>>> Luo lan:
>> >>>>     Thanks to merge my PR. It is my first PR, I feel very exciting.
>> >>>> Recently, I have bean writing a series of blogs about Dubbo. And, I
>> expect
>> >>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
>> popularity.
>> >>>>     Best wishes.
>> >>>>
>> >>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com>> 写道:
>> >>>>
>> >>>> Xiaobo,
>> >>>>
>> >>>> I notice that you've already updated pull request. Now the change
>> looks
>> >>>> good, and I've merged your pull request.
>> >>>>
>> >>>> Thanks,
>> >>>> -Ian.
>> >>>>
>> >>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com>> wrote:
>> >>>>
>> >>>>> Xiaobo,
>> >>>>>
>> >>>>> Would you mind to take a look at the comments I dropped on pull
>> >>>>> request 2686 [1] you proposed? Basically I think we could
>> completely remove
>> >>>>> isDelay method, if you agree with this idea, pls. follow up to
>> enhance your
>> >>>>> pull request.
>> >>>>>
>> >>>>> Thanks,
>> >>>>> -Ian.
>> >>>>>
>> >>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
>> >>>>>
>> >>>>
>> >>>>
>> >>>
>> >>
>> >
>
>
>



Re: pull request 2686

Posted by Ian Luo <ia...@gmail.com>.
> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。

I think this behavior is expected. The reason is, the best timing for Dubbo
to count down delay for exposing service is when Spring container is ready,
then this timing should be the moment when spring context gets refreshed,
since at this moment, all beans are settled, and are ready for wiring in
their dependencies. If it happens earlier, say, at the moment after
properties set, then Dubbo may fail to expose service because it depends on
other spring bean.

To conclude, Dubbo should start to expose services until spring context
gets refreshed, no matter delay or no-delay is configured. Unfortunately in
order to keep backward compatibility, considering not all spring versions
support context refresh callback, we have to start to expose services after
properties set if we find application listener is not supported, and hope
Dubbo service can be exposed normally.

I hope this can clarify the behavior.

-Ian.



On Thu, Nov 1, 2018 at 10:03 AM Zonghai Shang <yi...@apache.org> wrote:

> Hi,
>
> > 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> > delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
> export 暴露服务
> > delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> 时算起,此时由 afterPropertiesSet 调用 export暴露服务
>
> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>
> > 这是我目前所发现的问题,不知道和你说的是不是同一个。
>
> Yes, you are right.
>
> yiji
>
> 田 小波 <ti...@outlook.com> 于2018年11月1日周四 上午1:25写道:
>
> > Hi,
> >
> > 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> >
> > delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
> > export 暴露服务
> > delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> > 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
> >
> > 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> > supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
> > afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> > 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
> >
> > 这是我目前所发现的问题,不知道和你说的是不是同一个。
> >
> > - xiaobo
> >
> > 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org> 写道:
> >
> > Hi,
> >
> > 我认为这种修改会造成延迟暴露的bug。
> > 如果要在容器启动10秒后才进行服务暴露怎么办?
> > 原始意图delay= 10000表示10秒后执行。
> >
> > I think this modification will cause a delay in the exposure of the bug.
> > What if you want to expose the service 10 seconds after the spring
> > container started ?
> > The original intention delay = 10000 represents execution after 10
> > seconds.
> >
> > public synchronized void export() {
> >     if (delay != null && delay > 0) {
> >        // should be delay, eg: 1 seconds
> >         delayExportExecutor.schedule(new Runnable() {
> >             @Override
> >             public void run() {
> >                 doExport();
> >             }
> >         }, delay, TimeUnit.MILLISECONDS);
> >     } else {
> >         doExport();
> >     }
> > }
> >
> > yiji
> >
> > Ian Luo <ia...@gmail.com> 于2018年10月31日周三 下午5:50写道:
> >
> >> good good study, day day up. Looking forward to your contribution :)
> >>
> >> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com>
> wrote:
> >>
> >> > Yes, in fact, It is a plan. I'm learning Dubbo code by writing blogs
> >> way,
> >> > It can make me understand Dubbo code deeply. So, I need to finish my
> >> blogs
> >> > first before doing other thing.
> >> >
> >> > 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com> 写道:
> >> >
> >> > sounds like a plan :)
> >> >
> >> > Thanks,
> >> > -Ian.
> >> >
> >> > On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com>
> >> wrote:
> >> >
> >> >> OK. I will read these articles carefully and think about how to
> enhance
> >> >> them next month or later. Please wait.
> >> >>
> >> >> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com> 写道:
> >> >>
> >> >> Excellent post. You may consider to enhance
> >> >> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html
> and
> >> >> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
> >> >>
> >> >> -Ian.
> >> >>
> >> >> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <ti...@outlook.com>
> >> wrote:
> >> >>
> >> >>> Luo Ian:
> >> >>>
> >> >>> I will contribute more for Dubbo community in the future. I'm going
> to
> >> >>> submit a new PR to dubbo-website after my Dubbo blogs are finished.
> I
> >> am
> >> >>> now hastening to write blogs, and two blogs has bean finished. I
> will
> >> >>> finish remaining blogs next month. The first blog "Dubbo 源码分析 - SPI
> 机制
> >> >>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean
> published
> >> >>> on cnblogs.com. You may read it and give me some guidance if you
> have
> >> >>> interest and time, thanks.
> >> >>>
> >> >>> Best wishes,
> >> >>> -xiaobo.
> >> >>>
> >> >>>
> >> >>>
> >> >>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com> 写道:
> >> >>>
> >> >>> XiaoBo,
> >> >>>
> >> >>> Nice! Pls. consider contributing more to the community in the
> future.
> >> >>>
> >> >>> Recently, I have bean writing a series of blogs about Dubbo
> >> >>>
> >> >>> Pls. share the link with the community (send email to
> >> >>> dev@dubbo.apache.org) once you finish :) You can also consider to
> >> post
> >> >>> your article to Dubbo's website [1]. It will become another pull
> >> request
> >> >>> from you by the way :)
> >> >>>
> >> >>> Thanks,
> >> >>> -Ian.
> >> >>>
> >> >>> 1. https://github.com/apache/incubator-dubbo-website
> >> >>>
> >> >>>
> >> >>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com>
> >> wrote:
> >> >>>
> >> >>>> Luo lan:
> >> >>>>     Thanks to merge my PR. It is my first PR, I feel very exciting.
> >> >>>> Recently, I have bean writing a series of blogs about Dubbo. And, I
> >> expect
> >> >>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
> >> popularity.
> >> >>>>     Best wishes.
> >> >>>>
> >> >>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com> 写道:
> >> >>>>
> >> >>>> Xiaobo,
> >> >>>>
> >> >>>> I notice that you've already updated pull request. Now the change
> >> looks
> >> >>>> good, and I've merged your pull request.
> >> >>>>
> >> >>>> Thanks,
> >> >>>> -Ian.
> >> >>>>
> >> >>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com>
> wrote:
> >> >>>>
> >> >>>>> Xiaobo,
> >> >>>>>
> >> >>>>> Would you mind to take a look at the comments I dropped on pull
> >> >>>>> request 2686 [1] you proposed? Basically I think we could
> >> completely remove
> >> >>>>> isDelay method, if you agree with this idea, pls. follow up to
> >> enhance your
> >> >>>>> pull request.
> >> >>>>>
> >> >>>>> Thanks,
> >> >>>>> -Ian.
> >> >>>>>
> >> >>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
> >> >>>>>
> >> >>>>
> >> >>>>
> >> >>>
> >> >>
> >> >
> >
> >
> >
>

Re: pull request 2686

Posted by Zonghai Shang <yi...@apache.org>.
Hi,

> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
export 暴露服务
> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
时算起,此时由 afterPropertiesSet 调用 export暴露服务

> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。

> 这是我目前所发现的问题,不知道和你说的是不是同一个。

Yes, you are right.

yiji

田 小波 <ti...@outlook.com> 于2018年11月1日周四 上午1:25写道:

> Hi,
>
> 我重新看了代码和文档,发现确实存在一个延迟暴露的问题。这里先列举 Dubbo 的延迟暴露策略:
>
> delay = null 或 delay = -1 :延迟到 Spring 容器就绪后暴露服务,由 onApplicationEvent 调用
> export 暴露服务
> delay > 0 :延迟指定毫秒后暴露服务,时间从 afterPropertiesSet 调用 export
> 时算起,此时由 afterPropertiesSet 调用 export 暴露服务
>
> 当代码修改后,由于 afterPropertiesSet 不再对 delay 进行校验。导致当 delay > 0,且
> supportedApplicationListener = true 时,export 会被 onApplicationEvent 调用,而不是
> afterPropertiesSet。这会造成服务被延迟到 Spring 容器就绪后的 delay
> 毫秒暴露,而不是像之前被延迟到afterPropertiesSet 调用 export 后的 delay 毫秒暴露。
>
> 这是我目前所发现的问题,不知道和你说的是不是同一个。
>
> - xiaobo
>
> 在 2018年10月31日,下午10:43,Zonghai Shang <yi...@apache.org> 写道:
>
> Hi,
>
> 我认为这种修改会造成延迟暴露的bug。
> 如果要在容器启动10秒后才进行服务暴露怎么办?
> 原始意图delay= 10000表示10秒后执行。
>
> I think this modification will cause a delay in the exposure of the bug.
> What if you want to expose the service 10 seconds after the spring
> container started ?
> The original intention delay = 10000 represents execution after 10
> seconds.
>
> public synchronized void export() {
>     if (delay != null && delay > 0) {
>        // should be delay, eg: 1 seconds
>         delayExportExecutor.schedule(new Runnable() {
>             @Override
>             public void run() {
>                 doExport();
>             }
>         }, delay, TimeUnit.MILLISECONDS);
>     } else {
>         doExport();
>     }
> }
>
> yiji
>
> Ian Luo <ia...@gmail.com> 于2018年10月31日周三 下午5:50写道:
>
>> good good study, day day up. Looking forward to your contribution :)
>>
>> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com> wrote:
>>
>> > Yes, in fact, It is a plan. I'm learning Dubbo code by writing blogs
>> way,
>> > It can make me understand Dubbo code deeply. So, I need to finish my
>> blogs
>> > first before doing other thing.
>> >
>> > 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com> 写道:
>> >
>> > sounds like a plan :)
>> >
>> > Thanks,
>> > -Ian.
>> >
>> > On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com>
>> wrote:
>> >
>> >> OK. I will read these articles carefully and think about how to enhance
>> >> them next month or later. Please wait.
>> >>
>> >> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com> 写道:
>> >>
>> >> Excellent post. You may consider to enhance
>> >> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html and
>> >> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
>> >>
>> >> -Ian.
>> >>
>> >> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <ti...@outlook.com>
>> wrote:
>> >>
>> >>> Luo Ian:
>> >>>
>> >>> I will contribute more for Dubbo community in the future. I'm going to
>> >>> submit a new PR to dubbo-website after my Dubbo blogs are finished. I
>> am
>> >>> now hastening to write blogs, and two blogs has bean finished. I will
>> >>> finish remaining blogs next month. The first blog "Dubbo 源码分析 - SPI 机制
>> >>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean published
>> >>> on cnblogs.com. You may read it and give me some guidance if you have
>> >>> interest and time, thanks.
>> >>>
>> >>> Best wishes,
>> >>> -xiaobo.
>> >>>
>> >>>
>> >>>
>> >>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com> 写道:
>> >>>
>> >>> XiaoBo,
>> >>>
>> >>> Nice! Pls. consider contributing more to the community in the future.
>> >>>
>> >>> Recently, I have bean writing a series of blogs about Dubbo
>> >>>
>> >>> Pls. share the link with the community (send email to
>> >>> dev@dubbo.apache.org) once you finish :) You can also consider to
>> post
>> >>> your article to Dubbo's website [1]. It will become another pull
>> request
>> >>> from you by the way :)
>> >>>
>> >>> Thanks,
>> >>> -Ian.
>> >>>
>> >>> 1. https://github.com/apache/incubator-dubbo-website
>> >>>
>> >>>
>> >>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com>
>> wrote:
>> >>>
>> >>>> Luo lan:
>> >>>>     Thanks to merge my PR. It is my first PR, I feel very exciting.
>> >>>> Recently, I have bean writing a series of blogs about Dubbo. And, I
>> expect
>> >>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more
>> popularity.
>> >>>>     Best wishes.
>> >>>>
>> >>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com> 写道:
>> >>>>
>> >>>> Xiaobo,
>> >>>>
>> >>>> I notice that you've already updated pull request. Now the change
>> looks
>> >>>> good, and I've merged your pull request.
>> >>>>
>> >>>> Thanks,
>> >>>> -Ian.
>> >>>>
>> >>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com> wrote:
>> >>>>
>> >>>>> Xiaobo,
>> >>>>>
>> >>>>> Would you mind to take a look at the comments I dropped on pull
>> >>>>> request 2686 [1] you proposed? Basically I think we could
>> completely remove
>> >>>>> isDelay method, if you agree with this idea, pls. follow up to
>> enhance your
>> >>>>> pull request.
>> >>>>>
>> >>>>> Thanks,
>> >>>>> -Ian.
>> >>>>>
>> >>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
>> >>>>>
>> >>>>
>> >>>>
>> >>>
>> >>
>> >
>
>
>

Re: pull request 2686

Posted by Zonghai Shang <yi...@apache.org>.
Hi,

我认为这种修改会造成延迟暴露的bug。
如果要在容器启动10秒后才进行服务暴露怎么办?
原始意图delay= 10000表示10秒后执行。

I think this modification will cause a delay in the exposure of the bug.
What if you want to expose the service 10 seconds after the spring
container started ?
The original intention delay = 10000 represents execution after 10 seconds.

public synchronized void export() {
    if (delay != null && delay > 0) {
       // should be delay, eg: 1 seconds
        delayExportExecutor.schedule(new Runnable() {
            @Override
            public void run() {
                doExport();
            }
        }, delay, TimeUnit.MILLISECONDS);
    } else {
        doExport();
    }
}

yiji

Ian Luo <ia...@gmail.com> 于2018年10月31日周三 下午5:50写道:

> good good study, day day up. Looking forward to your contribution :)
>
> On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com> wrote:
>
> > Yes, in fact, It is a plan. I'm learning Dubbo code by writing blogs way,
> > It can make me understand Dubbo code deeply. So, I need to finish my
> blogs
> > first before doing other thing.
> >
> > 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com> 写道:
> >
> > sounds like a plan :)
> >
> > Thanks,
> > -Ian.
> >
> > On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com> wrote:
> >
> >> OK. I will read these articles carefully and think about how to enhance
> >> them next month or later. Please wait.
> >>
> >> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com> 写道:
> >>
> >> Excellent post. You may consider to enhance
> >> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html and
> >> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
> >>
> >> -Ian.
> >>
> >> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <ti...@outlook.com>
> wrote:
> >>
> >>> Luo Ian:
> >>>
> >>> I will contribute more for Dubbo community in the future. I'm going to
> >>> submit a new PR to dubbo-website after my Dubbo blogs are finished. I
> am
> >>> now hastening to write blogs, and two blogs has bean finished. I will
> >>> finish remaining blogs next month. The first blog "Dubbo 源码分析 - SPI 机制
> >>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean published
> >>> on cnblogs.com. You may read it and give me some guidance if you have
> >>> interest and time, thanks.
> >>>
> >>> Best wishes,
> >>> -xiaobo.
> >>>
> >>>
> >>>
> >>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com> 写道:
> >>>
> >>> XiaoBo,
> >>>
> >>> Nice! Pls. consider contributing more to the community in the future.
> >>>
> >>> Recently, I have bean writing a series of blogs about Dubbo
> >>>
> >>> Pls. share the link with the community (send email to
> >>> dev@dubbo.apache.org) once you finish :) You can also consider to post
> >>> your article to Dubbo's website [1]. It will become another pull
> request
> >>> from you by the way :)
> >>>
> >>> Thanks,
> >>> -Ian.
> >>>
> >>> 1. https://github.com/apache/incubator-dubbo-website
> >>>
> >>>
> >>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com>
> wrote:
> >>>
> >>>> Luo lan:
> >>>>     Thanks to merge my PR. It is my first PR, I feel very exciting.
> >>>> Recently, I have bean writing a series of blogs about Dubbo. And, I
> expect
> >>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more popularity.
> >>>>     Best wishes.
> >>>>
> >>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com> 写道:
> >>>>
> >>>> Xiaobo,
> >>>>
> >>>> I notice that you've already updated pull request. Now the change
> looks
> >>>> good, and I've merged your pull request.
> >>>>
> >>>> Thanks,
> >>>> -Ian.
> >>>>
> >>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com> wrote:
> >>>>
> >>>>> Xiaobo,
> >>>>>
> >>>>> Would you mind to take a look at the comments I dropped on pull
> >>>>> request 2686 [1] you proposed? Basically I think we could completely
> remove
> >>>>> isDelay method, if you agree with this idea, pls. follow up to
> enhance your
> >>>>> pull request.
> >>>>>
> >>>>> Thanks,
> >>>>> -Ian.
> >>>>>
> >>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
> >>>>>
> >>>>
> >>>>
> >>>
> >>
> >
>

Re: pull request 2686

Posted by Ian Luo <ia...@gmail.com>.
good good study, day day up. Looking forward to your contribution :)

On Wed, Oct 31, 2018 at 4:43 PM 田 小波 <ti...@outlook.com> wrote:

> Yes, in fact, It is a plan. I'm learning Dubbo code by writing blogs way,
> It can make me understand Dubbo code deeply. So, I need to finish my blogs
> first before doing other thing.
>
> 在 2018年10月31日,下午3:11,Ian Luo <ia...@gmail.com> 写道:
>
> sounds like a plan :)
>
> Thanks,
> -Ian.
>
> On Wed, Oct 31, 2018 at 2:53 PM 田 小波 <ti...@outlook.com> wrote:
>
>> OK. I will read these articles carefully and think about how to enhance
>> them next month or later. Please wait.
>>
>> 在 2018年10月31日,下午2:26,Ian Luo <ia...@gmail.com> 写道:
>>
>> Excellent post. You may consider to enhance
>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi.html and
>> http://dubbo.apache.org/zh-cn/blog/introduction-to-dubbo-spi-2.html.
>>
>> -Ian.
>>
>> On Wed, Oct 31, 2018 at 1:36 PM 田 小波 <ti...@outlook.com> wrote:
>>
>>> Luo Ian:
>>>
>>> I will contribute more for Dubbo community in the future. I'm going to
>>> submit a new PR to dubbo-website after my Dubbo blogs are finished. I am
>>> now hastening to write blogs, and two blogs has bean finished. I will
>>> finish remaining blogs next month. The first blog "Dubbo 源码分析 - SPI 机制
>>> <https://www.cnblogs.com/nullllun/p/9758682.html>" has bean published
>>> on cnblogs.com. You may read it and give me some guidance if you have
>>> interest and time, thanks.
>>>
>>> Best wishes,
>>> -xiaobo.
>>>
>>>
>>>
>>> 在 2018年10月31日,上午10:08,Ian Luo <ia...@gmail.com> 写道:
>>>
>>> XiaoBo,
>>>
>>> Nice! Pls. consider contributing more to the community in the future.
>>>
>>> Recently, I have bean writing a series of blogs about Dubbo
>>>
>>> Pls. share the link with the community (send email to
>>> dev@dubbo.apache.org) once you finish :) You can also consider to post
>>> your article to Dubbo's website [1]. It will become another pull request
>>> from you by the way :)
>>>
>>> Thanks,
>>> -Ian.
>>>
>>> 1. https://github.com/apache/incubator-dubbo-website
>>>
>>>
>>> On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com> wrote:
>>>
>>>> Luo lan:
>>>>     Thanks to merge my PR. It is my first PR, I feel very exciting.
>>>> Recently, I have bean writing a series of blogs about Dubbo. And, I expect
>>>> to submit more PR for Dubbo. Lastly, I hope Dubbo get more popularity.
>>>>     Best wishes.
>>>>
>>>> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com> 写道:
>>>>
>>>> Xiaobo,
>>>>
>>>> I notice that you've already updated pull request. Now the change looks
>>>> good, and I've merged your pull request.
>>>>
>>>> Thanks,
>>>> -Ian.
>>>>
>>>> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com> wrote:
>>>>
>>>>> Xiaobo,
>>>>>
>>>>> Would you mind to take a look at the comments I dropped on pull
>>>>> request 2686 [1] you proposed? Basically I think we could completely remove
>>>>> isDelay method, if you agree with this idea, pls. follow up to enhance your
>>>>> pull request.
>>>>>
>>>>> Thanks,
>>>>> -Ian.
>>>>>
>>>>> 1. https://github.com/apache/incubator-dubbo/pull/2686
>>>>>
>>>>
>>>>
>>>
>>
>

Re: pull request 2686

Posted by Ian Luo <ia...@gmail.com>.
XiaoBo,

Nice! Pls. consider contributing more to the community in the future.

Recently, I have bean writing a series of blogs about Dubbo

Pls. share the link with the community (send email to dev@dubbo.apache.org)
once you finish :) You can also consider to post your article to Dubbo's
website [1]. It will become another pull request from you by the way :)

Thanks,
-Ian.

1. https://github.com/apache/incubator-dubbo-website


On Tue, Oct 30, 2018 at 9:20 PM 田 小波 <ti...@outlook.com> wrote:

> Luo lan:
>     Thanks to merge my PR. It is my first PR, I feel very exciting.
> Recently, I have bean writing a series of blogs about Dubbo. And, I expect
> to submit more PR for Dubbo. Lastly, I hope Dubbo get more popularity.
>     Best wishes.
>
> 在 2018年10月30日,下午5:14,Ian Luo <ia...@gmail.com> 写道:
>
> Xiaobo,
>
> I notice that you've already updated pull request. Now the change looks
> good, and I've merged your pull request.
>
> Thanks,
> -Ian.
>
> On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com> wrote:
>
>> Xiaobo,
>>
>> Would you mind to take a look at the comments I dropped on pull request
>> 2686 [1] you proposed? Basically I think we could completely remove isDelay
>> method, if you agree with this idea, pls. follow up to enhance your pull
>> request.
>>
>> Thanks,
>> -Ian.
>>
>> 1. https://github.com/apache/incubator-dubbo/pull/2686
>>
>
>

Re: pull request 2686

Posted by Ian Luo <ia...@gmail.com>.
Xiaobo,

I notice that you've already updated pull request. Now the change looks
good, and I've merged your pull request.

Thanks,
-Ian.

On Tue, Oct 30, 2018 at 11:19 AM Ian Luo <ia...@gmail.com> wrote:

> Xiaobo,
>
> Would you mind to take a look at the comments I dropped on pull request
> 2686 [1] you proposed? Basically I think we could completely remove isDelay
> method, if you agree with this idea, pls. follow up to enhance your pull
> request.
>
> Thanks,
> -Ian.
>
> 1. https://github.com/apache/incubator-dubbo/pull/2686
>