You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by zr...@apache.org on 2025/11/13 06:15:07 UTC
(dubbo) branch 3.3 updated: Fix issue #15698 Distinguish between timeout and task rejection in DefaultFuture (#15738)
This is an automated email from the ASF dual-hosted git repository.
zrlw pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.3 by this push:
new c6e619b0dc Fix issue #15698 Distinguish between timeout and task rejection in DefaultFuture (#15738)
c6e619b0dc is described below
commit c6e619b0dc5b12620575a0870e8d01fb7b176dc6
Author: qxggg <90...@users.noreply.github.com>
AuthorDate: Thu Nov 13 14:15:00 2025 +0800
Fix issue #15698 Distinguish between timeout and task rejection in DefaultFuture (#15738)
---
.../dubbo/remoting/exchange/support/DefaultFuture.java | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
index f18edb0881..08ca7cfb66 100644
--- a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
+++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
@@ -328,7 +328,7 @@ public class DefaultFuture extends CompletableFuture<Object> {
try {
executor.execute(() -> notifyTimeout(future));
} catch (RejectedExecutionException e) {
- notifyTimeout(future);
+ notifyExecutionError(future, e);
throw e;
}
} else {
@@ -345,5 +345,17 @@ public class DefaultFuture extends CompletableFuture<Object> {
// handle response.
DefaultFuture.received(future.getChannel(), timeoutResponse, true);
}
+
+ private void notifyExecutionError(DefaultFuture future, Throwable e) {
+ // create exception response.
+ Response errorResponse = new Response(future.getId());
+ // set error status
+ errorResponse.setStatus(Response.SERVER_THREADPOOL_EXHAUSTED_ERROR);
+ // set detailed error message
+ errorResponse.setErrorMessage("Executor rejected the task for handling timeout notification: "
+ + e.getClass().getSimpleName() + " - " + e.getMessage());
+ // handle response.
+ DefaultFuture.received(future.getChannel(), errorResponse, true);
+ }
}
}