You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "wangshunwei (via GitHub)" <gi...@apache.org> on 2024/01/10 08:38:56 UTC

Re: [PR] Fix long time await in ThreadlessExecutor [dubbo]

wangshunwei commented on code in PR #12484:
URL: https://github.com/apache/dubbo/pull/12484#discussion_r1447046980


##########
dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/ThreadlessExecutor.java:
##########
@@ -52,14 +52,18 @@ public class ThreadlessExecutor extends AbstractExecutorService {
      * Waits until there is a task, executes the task and all queued tasks (if there're any). The task is either a normal
      * response or a timeout response.
      */
-    public void waitAndDrain() throws InterruptedException {
+    public void waitAndDrain(long deadline) throws InterruptedException {
         throwIfInterrupted();
         Runnable runnable = queue.poll();
         if (runnable == null) {
             waiter = Thread.currentThread();
             try {
                 while ((runnable = queue.poll()) == null) {
-                    LockSupport.park(this);

Review Comment:
   如果这个take操作耗时比较长,是什么原因。provider一直没往里面放序列化后的数据吗?然后消费者一直等待take数据,导致接口耗时增加。



-- 
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