xintongsong commented on code in PR #20912:
URL: https://github.com/apache/flink/pull/20912#discussion_r981962104


##########
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamConfig.java:
##########
@@ -176,10 +175,18 @@ public CompletableFuture<StreamConfig> 
triggerSerializationAndReturnFuture(
                                                                 
Function.identity())),
                                         this.config,
                                         CHAINED_TASK_CONFIG);
-                            } catch (IOException e) {
-                                throw new StreamTaskException(
-                                        "Could not serialize object for key 
chained task config.",
-                                        e);
+                            } catch (IOException | StreamTaskException e) {
+                                StreamTaskException serializationException;
+                                if (e instanceof IOException) {
+                                    serializationException =
+                                            new StreamTaskException(
+                                                    "Could not serialize 
object for key chained task config.",
+                                                    e);
+                                } else {
+                                    serializationException = 
(StreamTaskException) e;
+                                }
+                                
serializationFuture.completeExceptionally(serializationException);
+                                throw serializationException;

Review Comment:
   There's no point of throwing an exception in this thread. I think we can 
simply catch any throwable and complete the future with them.



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