StephanEwen commented on a change in pull request #11048:
[FLINK-15966][runtime] Capture callstacks for RPC ask() calls to improve
exceptions.
URL: https://github.com/apache/flink/pull/11048#discussion_r380311882
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java
##########
@@ -370,4 +375,33 @@ public String getHostname() {
public CompletableFuture<Void> getTerminationFuture() {
return terminationFuture;
}
+
+ static Object deserializeValueIfNeeded(Object o, Method method) {
+ if (o instanceof SerializedValue) {
+ try {
+ return ((SerializedValue<?>)
o).deserializeValue(AkkaInvocationHandler.class.getClassLoader());
+ } catch (IOException | ClassNotFoundException e) {
+ throw new CompletionException(
+ new RpcException(
+ "Could not deserialize the
serialized payload of RPC method : " + method.getName(), e));
+ }
+ } else {
+ return o;
+ }
+ }
+
+ static Throwable resolveTimeoutException(Throwable exception, @Nullable
Throwable callStackCapture, Method method) {
+ if (callStackCapture == null || (!(exception instanceof
akka.pattern.AskTimeoutException))) {
+ return exception;
Review comment:
I think that would be fine.
The main reason that I wanted this configurable is to have a way to turn
call stack capture off, because during large RPC storms, this might add
significantly to the memory consumption.
But always using a `TimeoutException` and referring to the RPC method name
should be uncritical.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services