tillrohrmann commented on a change in pull request #16345:
URL: https://github.com/apache/flink/pull/16345#discussion_r666036209
##########
File path:
flink-rpc/flink-rpc-akka/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java
##########
@@ -229,22 +230,29 @@ private Object invokeRpc(Method method, Object[] args)
throws Exception {
final CompletableFuture<Object> completableFuture = new
CompletableFuture<>();
resultFuture.whenComplete(
- (resultValue, failure) -> {
- if (failure != null) {
- completableFuture.completeExceptionally(
- resolveTimeoutException(failure,
callStackCapture, method));
- } else {
- completableFuture.complete(
- deserializeValueIfNeeded(resultValue,
method));
- }
- });
+ (resultValue, failure) ->
+ ClassLoadingUtils.runWithFlinkContextClassLoader(
+ () -> {
+ if (failure != null) {
+
completableFuture.completeExceptionally(
+ resolveTimeoutException(
+ failure,
callStackCapture, method));
+ } else {
+ completableFuture.complete(
+
deserializeValueIfNeeded(resultValue, method));
+ }
+ }));
if (Objects.equals(returnType, CompletableFuture.class)) {
result = completableFuture;
} else {
try {
result =
- completableFuture.get(futureTimeout.getSize(),
futureTimeout.getUnit());
+ ClassLoadingUtils.runWithFlinkContextClassLoader(
+ () ->
+ completableFuture.get(
+ futureTimeout.getSize(),
+ futureTimeout.getUnit()));
Review comment:
Shouldn't we come from Flink land when we are at this place? If this is
the case, then we shouldn't need to set the context class loader again.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]