[ 
https://issues.apache.org/jira/browse/GIRAPH-73?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13171809#comment-13171809
 ] 

Sebastian Schelter commented on GIRAPH-73:
------------------------------------------

You are right. 

The problem is that if there is an exception thrown in the try { ... } block 
and another exception is thrown in the finally { ... } block, than you only get 
to see the second one. That's why people usually choose to swallow and only log 
the exceptions arising from close. 

Should I rework the patch to ensure the job will be failed in case there are 
exceptions in closeQuietly()? 


Here are some details about stream handling in java (it's a mess...)
http://illegalargumentexception.blogspot.com/2008/10/java-how-not-to-make-mess-of-stream.html
                
> A little refactoring
> --------------------
>
>                 Key: GIRAPH-73
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-73
>             Project: Giraph
>          Issue Type: Improvement
>    Affects Versions: 0.70.0
>            Reporter: Sebastian Schelter
>            Priority: Minor
>         Attachments: GIRAPH-73-2.patch, GIRAPH-73.patch
>
>
> Hi, I'm currently reading Giraph's sources and starting to play with it. I 
> fixed some small things along the way (like making sure writers are closed, 
> exceptions are logged, etc.), thought that maybe helpful.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to