You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/09/29 06:06:19 UTC

[GitHub] [dubbo] zrlw opened a new issue #8949: HashedWheelTimer

zrlw opened a new issue #8949:
URL: https://github.com/apache/dubbo/issues/8949


   ### Environment
   
   * Dubbo version: 3.0 / master
   1. waitForNextTick想法有点多
   ```
                   final long currentTime = System.nanoTime() - startTime; <== startTime是初始化HashedWheelTimer的时间,currentTime是时间差,应用程序持续运行时间只要不超过292年,currentTime这个值都不会小于0。即使System.nanoTime()返回的当前时间超过LONG最大值变成了负数,它和startTime之间的纳秒时间差只要不超过2^63次方-1,currentTime就不会变成负值。
                   long sleepTimeMs = (deadline - currentTime + 999999) / 1000000;
   
                   if (sleepTimeMs <= 0) {
                       if (currentTime == Long.MIN_VALUE) {  
                           <==  Long.MIN_VALUE是-2^63,程序要持续运行262年之后才有遇到它的机会;返回负值也有问题,调用waitForNextTick的代码只认返回值大于0的情况。
                           return -Long.MAX_VALUE;  
                       } else {
                           return currentTime;
                       }
                   }
   ```
   2. HashedWheelTimer的maxPendingTimeouts可以任意设置,但实际情况是超过cpu核数时,超时机制就会混乱起来,原因是sleep的线程太多了,sleep时间到了也抢不到cpu。 
   HashedWheelTimerTest的createTaskTest测试方法在4核windows机器上跑单元测试,多半失败:
   ```
           Thread.sleep(100); 《== 实测发现执行expireTimeouts的线程很少能在1秒内抢到cpu,所以这里的100ms是想当然了
           Assertions.assertTrue(timeout.isExpired());
   
           timer.stop();
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-932857178


   考虑再三还是选了newFixedThreadPool来执行timer task,相比cached线程池,fixed线程池消耗的资源相对较少。只是fixed线程池本身有无限队列的问题,但是如果把等待队列设为有界,我不知道设置多大合适,还有超出队列容量的任务要怎么处理。
   即使这样修改,worker thread能够不受task任务影响持续正常运转,但是如果timeout task任务本身代码效率低、执行慢,当排队等待执行的timeout task数量超过newFixedThreadPool容量时,依旧会出超时任务执行时间滞后的问题,这种情况只修改HashedWheelTimer是搞不定的。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-933202444


   netty反馈他们采用了httpclient5的类似做法,在构造方法上加了一个Executor入参。
   https://github.com/netty/netty/pull/11728
   和这里的PR修改内容本质上没有差别,只是如果照搬netty的方法,dubbo要改的代码貌似有点多了,感觉不太值。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-933188123


   event loop和event process的处理线程还是分离好一些,或者像apache httpclient5的FutureRequestExecutionService的构造函数那样,要求用户自己提供一个ExecutorService来执行异步task。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930761383


   我看了netty的HashedWheelTimer代码并没有修复这个问题。
   worker线程执行while循环时,如果有超时任务则直接用worker线程自己去执行,如果执行任务挂住了,那么worker线程也会挂住不动,后面的循环都会一直等着,这样超时机制就会错过正常时间点了。
   
   给netty提的issue:
   https://github.com/netty/netty/issues/11724


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-932857178


   考虑再三还是选了newFixedThreadPool来执行timer task,相比比cached线程池,fixed线程池消耗的资源相对较少。只是fixed线程池本身有无限队列的问题,但是如果把等待队列设为有界,我不知道设置多大合适,还有超出队列容量的任务要怎么处理。
   即使这样修改,worker thread能够不受task任务影响持续正常运转,但是如果timeout task任务本身代码效率低、执行慢,当排队等待执行的timeout task数量超过newFixedThreadPool容量时,依旧会出超时任务执行时间滞后的问题,这种情况只修改HashedWheelTimer是搞不定的。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930761383


   我看了netty的HashedWheelTimer代码并没有修复这个问题。
   worker线程执行while循环时,如果有超时任务则直接用worker线程自己去执行,如果执行任务挂住了,那么worker线程也会挂住不动,后面的循环都会一直等着,这样超时机制就会错过正常时间点了。
   
   更新:我昨天给netty提了个PR,netty member答复就是这样的,netty是串行循环通知,在串行循环过程中,每个事件处理的代码都不能阻塞netty的worker线程。我问他们如果有10000个timeout,每个处理耗时都只有10ms,那么串行通知完也要耗时100s,是否合理,然后PR就被关了。
   issue还在:
   https://github.com/netty/netty/issues/11724


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer的timeout任务执行时间不准

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930761383


   我看了netty的HashedWheelTimer代码并没有修复这个问题。
   worker线程执行while循环时,如果有超时任务则直接用worker线程自己去执行,如果执行任务挂住了,那么worker线程也会挂住不动,后面的循环都会一直等着,这样超时机制就会错过正常时间点了。
   我去给netty也提个PR吧。
   https://github.com/netty/netty/pull/11723


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8949: HashedWheelTimer的timeout任务执行时间不准

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930777206


   参照netty的做法,sleepTimeMs为0时改为等待1秒了。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-933202444


   有个netty的member提交了一个PR,HashedWheelTimer类增加一个带Executor入参的构造函数。
   https://github.com/netty/netty/pull/11728
   也有不同意见,有netty member认为并不需要改,task任务自己耗时长需要另开线程就让task自己开就好了。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer的timeout任务执行时间不准

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930761383


   我看了netty的HashedWheelTimer代码并没有修复这个问题。
   worker线程执行while循环时,如果有超时任务则直接用worker线程自己去执行,如果执行任务挂住了,那么worker线程也会挂住不动,后面的循环都会一直等着,这样超时机制就会错过正常时间点了。
   我去给netty也提个PR吧。
   https://github.com/netty/netty/pull/11724


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-933202444


   有位netty member提交了一个PR,HashedWheelTimer类增加一个带Executor入参的构造函数。
   https://github.com/netty/netty/pull/11728
   虽然有netty member认为并不需要改,但该PR已merged。
   
   更新:参照netty的PR 11728重新做了修订,不同之处是默认的executor改成了static fixedThreadpool全局共享线程池。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #8949: HashedWheelTimer的timeout任务执行时间不准

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930686838


   HashedWheelTimer 是参考 netty 实现的,上面有的问题在 netty 的最新版本里面已经修复了,是不是照着 netty 的修改过来就好。
   https://github.com/netty/netty/blob/4.1/common/src/main/java/io/netty/util/HashedWheelTimer.java
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8949: HashedWheelTimer的timeout任务执行时间不准

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930943534


   还要单独创建线程池执行timeout任务,如果复用worker的threadFactory,当池子容量很小,timeout任务很多,任务就会积压,导致timeout任务处理时间严重滞后。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-933202444


   netty反馈他们采用了httpclient5的类似做法,在构造方法上加了一个Executor入参。
   https://github.com/netty/netty/pull/11728


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930761383


   我看了netty的HashedWheelTimer代码并没有修复这个问题。
   worker线程执行while循环时,如果有超时任务则直接用worker线程自己去执行,如果执行任务挂住了,那么worker线程也会挂住不动,后面的循环都会一直等着,这样超时机制就会错过正常时间点了。
   
   更新:我昨天给netty提了个PR,netty member答复就是这样的,netty是串行循环通知,在串行循环过程中,每个事件处理的代码都不能阻塞netty的worker线程。我问如果有10000个timeout,每个处理耗时都只有10ms,那么串行通知完也要耗时100s,是否合理,然后PR就被关了。
   issue还在:
   https://github.com/netty/netty/issues/11724


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer的timeout任务执行时间不准

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930761383


   我看了netty的HashedWheelTimer代码并没有修复这个问题。
   worker线程执行while循环时,如果有超时任务则直接用worker线程自己去执行,如果执行任务挂住了,那么worker线程也会挂住不动,后面的循环都会一直等着,这样超时机制就会错过正常时间点了。
   
   更新:我昨天给netty提了个PR,netty管理团队答复就是这样的,netty是串行循环通知,在串行循环过程中,每个事件处理的代码都不能阻塞netty的worker线程。我问他们如果有10000个timeout,每个处理耗时都只有10ms,那么串行通知完也要耗时100s,是否合理,然后PR就被关了。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930777206


   参照netty的做法,sleepTimeMs为0时改为等待1毫秒了。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer的timeout任务执行时间不准

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930761383


   我看了netty的HashedWheelTimer代码并没有修复这个问题。
   worker线程执行while循环时,如果有超时任务则直接用worker线程自己去执行,如果执行任务挂住了,那么worker线程也会挂住不动,后面的循环都会一直等着,这样超时机制就会错过正常时间点了。
   
   更新:我昨天给netty提了个PR,netty管理团队答复就是这样的,netty是串行循环通知,在串行循环过程中,每个事件处理的代码都不能阻塞netty的worker线程。我问他们如果有10000个timeout,每个处理耗时都只有10ms,那么串行通知完也要耗时10s,是否合理,然后PR就被关了。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-933202444


   netty反馈他们准备采用httpclient5的做法,HashedWheelTimer加一个带Executor入参的构造函数。
   https://github.com/netty/netty/pull/11728
   和这里的PR修改内容本质上没有差别,只是如果照搬netty的PR,dubbo要改的代码貌似有点多。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-933202444


   netty反馈他们准备采用httpclient5的做法,HashedWheelTimer加一个带Executor入参的构造函数。
   https://github.com/netty/netty/pull/11728
   和这里的PR修改内容本质上没有差别,只是如果照搬netty的方法,dubbo要改的代码貌似有点多了,感觉不太值。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-933202444


   netty反馈他们准备采用httpclient5的做法,HashedWheelTimer加一个带Executor入参的构造函数。
   https://github.com/netty/netty/pull/11728
   和这里的PR修改内容本质上没有差别,只是如果照搬netty的方法,dubbo要改的代码貌似有点多。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-933202444


   有个netty member提交了一个PR,HashedWheelTimer类增加一个带Executor入参的构造函数。
   https://github.com/netty/netty/pull/11728
   也有netty member认为并不需要改,task任务自己耗时长需要另开线程就让task自己开就好了。
   
   更新:PR内容参照netty的PR 11728做了修订,不同之处是默认的executor改成了static fixedThreadpool全局共享线程池。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-933202444


   有个netty member提交了一个PR,HashedWheelTimer类增加一个带Executor入参的构造函数。
   https://github.com/netty/netty/pull/11728
   也有netty member认为并不需要改,task任务自己耗时长需要另开线程就让task自己开就好了。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930761383


   我看了netty的HashedWheelTimer代码并没有修复这个问题。
   worker线程执行while循环时,如果有超时任务则直接用worker线程自己去执行,如果执行任务挂住了,那么worker线程也会挂住不动,后面的循环都会一直等着,这样超时机制就会错过正常时间点了。
   
   更新:我昨天给netty提了个PR,netty管理团队答复就是这样的,netty是串行循环通知,在串行循环过程中,每个事件处理的代码都不能阻塞netty的worker线程。我问他们如果有10000个timeout,每个处理耗时都只有10ms,那么串行通知完也要耗时100s,是否合理,然后PR就被关了。
   issue还在:
   https://github.com/netty/netty/issues/11724


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8949: HashedWheelTimer worker thread might have accumulative delay problem

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-933198365


   apache httpclient5的FutureRequestExecutionService采取的方式是构造函数提供一个ExecutorService入参,由用户负责创建并用来执行异步任务。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8949: HashedWheelTimer的timeout任务执行时间不准

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8949:
URL: https://github.com/apache/dubbo/issues/8949#issuecomment-930761383


   我看了netty的HashedWheelTimer代码并没有修复这个问题。
   worker线程执行while循环时,如果有超时任务则直接用worker线程自己去执行,如果执行任务挂住了,那么worker线程也会挂住不动,后面的循环都会一直等着,这样超时机制就会错过正常时间点了。
   我去给netty也提个PR吧。
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org