azagrebin commented on a change in pull request #8646: [FLINK-12735][network] 
Make shuffle environment implementation independent with IOManager
URL: https://github.com/apache/flink/pull/8646#discussion_r298940775
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/IOManagerAsync.java
 ##########
 @@ -126,22 +131,20 @@ public void close() {
                        // close writing and reading threads with best effort 
and log problems
                        // first notify all to close, then wait until all are 
closed
 
-                       for (WriterThread wt : writers) {
-                               try {
-                                       wt.shutdown();
-                               }
-                               catch (Throwable t) {
-                                       LOG.error("Error while shutting down IO 
Manager writer thread.", t);
-                               }
-                       }
-                       for (ReaderThread rt : readers) {
-                               try {
-                                       rt.shutdown();
-                               }
-                               catch (Throwable t) {
-                                       LOG.error("Error while shutting down IO 
Manager reader thread.", t);
-                               }
-                       }
+                       Iterable<AutoCloseable> writerThreadCloseables = 
Arrays.stream(writers)
+                               .filter(Objects::nonNull)
+                               .filter(Thread::isAlive)
 
 Review comment:
   do we need `Objects::nonNull` and `Thread::isAlive` filters here?

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

Reply via email to