Skip to content

Commit a15873e

Browse files
committed
finished issue 15698
1 parent 9fdf867 commit a15873e

File tree

1 file changed

+13
-2
lines changed
  • dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support

1 file changed

+13
-2
lines changed

dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,7 @@ public void run(Timeout timeout) {
328328
try {
329329
executor.execute(() -> notifyTimeout(future));
330330
} catch (RejectedExecutionException e) {
331-
notifyTimeout(future);
332-
throw e;
331+
notifyExecutionError(future, e);
333332
}
334333
} else {
335334
notifyTimeout(future);
@@ -345,5 +344,17 @@ private void notifyTimeout(DefaultFuture future) {
345344
// handle response.
346345
DefaultFuture.received(future.getChannel(), timeoutResponse, true);
347346
}
347+
348+
private void notifyExecutionError(DefaultFuture future, Throwable e) {
349+
// create exception response.
350+
Response errorResponse = new Response(future.getId());
351+
// set error status
352+
errorResponse.setStatus(Response.SERVER_THREADPOOL_EXHAUSTED_ERROR);
353+
// set detailed error message
354+
errorResponse.setErrorMessage("Executor rejected the task for handling timeout notification: "
355+
+ e.getClass().getSimpleName() + " - " + e.getMessage());
356+
// handle response.
357+
DefaultFuture.received(future.getChannel(), errorResponse, true);
358+
}
348359
}
349360
}

0 commit comments

Comments
 (0)