Apache9 commented on a change in pull request #2825:
URL: https://github.com/apache/hbase/pull/2825#discussion_r549907829



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
##########
@@ -832,7 +832,7 @@ private void finishActiveMasterInitialization(MonitoredTask 
status) throws IOExc
             HBaseFsck.createLockRetryCounterFactory(this.conf).create());
       } finally {
         if (result != null) {
-          IOUtils.closeQuietly(result.getSecond());
+          Closeables.close(result.getSecond(), true);

Review comment:
       Closeables.close will still throw IOExceptions on the method signature, 
so usually it is only suitable to be used in UT, where we are free to change 
the method signature.
   IOUtils.closeQuietly will not throw any exceptions but you need to pass in a 
consumer to process the IOException(usually just a logging).
   Closeables.closeQuietly is for closing Reader and InputStream, where we will 
not throw any exceptions.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to