flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] pnowojski commented on a change in pull request #6705: [FLINK-10356][network] add sanity checks to SpillingAdaptiveSpanningRecordDeserializer
Date Fri, 01 Mar 2019 14:20:20 GMT
pnowojski commented on a change in pull request #6705: [FLINK-10356][network] add sanity checks
to SpillingAdaptiveSpanningRecordDeserializer
URL: https://github.com/apache/flink/pull/6705#discussion_r261607555
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpillingAdaptiveSpanningRecordDeserializer.java
 ##########
 @@ -550,6 +550,7 @@ private void addNextChunkFromMemorySegment(MemorySegment segment, int
offset, in
 				}
 				else {
 					spillingChannel.close();
+					spillingChannel = null;
 
 Review comment:
   My point is after all you are fixing the inconsistency in resetting all fields correctly,
which was caused by this code duplication. Either this inconsistency you are fixing here,
is not worth fixing at all or we should make it more future proof to avoid such kind of errors
in the future. Especially that it's not testable.
   
   After all:
   ```
   private void closeSpillingChannel() throws IOException {
   			if (spillingChannel != null) {
   				... tmp = spillingChannel;
   				spillingChannel = null;
   				tmp.close();
   			}
   }
   private void closeSpillingChannelIgnoreException() {
     				try {
   					closeSpillingChannelI();
   				}
   				catch (Throwable t) {
   					// ignore
   				}
   }
   ```
   is not that messy.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message