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_r261610364
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpillingAdaptiveSpanningRecordDeserializer.java
 ##########
 @@ -575,6 +615,18 @@ private void 
moveRemainderToNonSpanningDeserializer(NonSpanningWrapper deseriali
                        }
                }
 
+               private int getRemainingBytes() {
+                       if (this.spillFileReader == null) {
+                               return this.serializationReadBuffer.available();
+                       } else {
+                               try {
+                                       return this.spillFileReader.available();
+                               } catch (IOException ignored) {
 
 Review comment:
   Ok. I would keep the current name, but maybe return `-1`? Or 
`Integer.MIN_VALUE`? And add small comment why is it better to ignore the 
exception here:
   ```
   /** 
    * @return In case of error returns Int.MIN_VALUE/-1. This method is used 
for error reporting and throwing exception from here could hide the original 
exception that we want to report. 
    */
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to