Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public void run(Timeout timeout) {
try {
executor.execute(() -> notifyTimeout(future));
} catch (RejectedExecutionException e) {
notifyTimeout(future);
notifyExecutionError(future, e);
throw e;
}
} else {
Expand All @@ -345,5 +345,17 @@ private void notifyTimeout(DefaultFuture future) {
// 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);
}
}
}
Loading