zentol commented on a change in pull request #16345:
URL: https://github.com/apache/flink/pull/16345#discussion_r665926897
##########
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:
We've seen in the past that calling `get()` can result in other
dependent stages being run in the current thread, implying that the thread
steps into Flink land.
--
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]