wbo4958 commented on pull request #3222:
URL: https://github.com/apache/hadoop/pull/3222#issuecomment-886314881


   Hi @steveloughran 
   
   I modified the unit tests which can cover the NPE described in the JIRA, and 
I ran the Integration tests and some tests failed. I don't know if the failed 
unit tests are expected. I updated the test result in 
https://issues.apache.org/jira/browse/HADOOP-17812?focusedCommentId=17386993&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17386993
 
   
   I still think throwing exception when wrappedStream equals null may be 
better. If we use
   ``` java
            try {
               if (wrappedStream == null) {
                 onReadFailure(null, 1, false);
               }
               b = wrappedStream.read();
             } catch (EOFException e) {
               return -1;
             } catch (SocketTimeoutException e) {
               onReadFailure(e, 1, true);
               throw e;
             } catch (IOException e) {
               onReadFailure(e, 1, false);
               throw e;
             }
   ```
   if onReadFailure called when detecting wrappedStream==null is failed, then 
the onReadFailure will be called again in the block of  `catch (IOException e) 
{` ,  My intention is to let the retry do that.
   
   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to