gaborgsomogyi commented on code in PR #29193:
URL: https://github.com/apache/flink/pull/29193#discussion_r4025575528


##########
flink-clients/src/main/java/org/apache/flink/client/ClientUtils.java:
##########
@@ -171,11 +171,18 @@ public static void waitUntilJobInitializationFinished(
             if (status == JobStatus.FAILED) {
                 JobResult result = jobResultSupplier.get();
                 Optional<SerializedThrowable> throwable = 
result.getSerializedThrowable();
-                if (throwable.isPresent()) {
-                    Throwable t = 
throwable.get().deserializeError(userCodeClassloader);
-                    if (t instanceof JobInitializationException) {
-                        throw t;
-                    }
+                // Checked via the safe class-name field, not 
deserializeError(): this result may
+                // come from a remote JobManager (e.g. when submitting through 
a shared session
+                // cluster), and JobInitializationException is the one, fixed, 
Flink-internal
+                // type we ever need to reconstruct here.
+                if (throwable.isPresent()
+                        && JobInitializationException.class
+                                .getName()
+                                
.equals(throwable.get().getOriginalErrorClassName())) {
+                    throw new JobInitializationException(
+                            result.getJobId(),
+                            stripOriginalClassNamePrefix(throwable.get()),

Review Comment:
   `stripOriginalClassNamePrefix` is needed because 
https://github.com/apache/flink/pull/19615 introduced a change which prefixes 
the class before the message. I'm not 100% convinced that we want to go on that 
road, namely if we want to keep original message then we need such hacks.



-- 
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]

Reply via email to