dineshchitlangia commented on a change in pull request #942:
URL: https://github.com/apache/hadoop-ozone/pull/942#discussion_r428424600
##########
File path:
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java
##########
@@ -317,10 +317,16 @@ private void handleFullBuffer() throws IOException {
if (!commitWatcher.getFutureMap().isEmpty()) {
waitOnFlushFutures();
}
- } catch (InterruptedException | ExecutionException e) {
+ } catch (ExecutionException e) {
setIoException(e);
adjustBuffersOnException();
throw getIoException();
+ } catch (InterruptedException ex) {
+ LOG.error("Command execution was interrupted.");
+ Thread.currentThread().interrupt();
+ setIoException(ex);
+ adjustBuffersOnException();
Review comment:
@bharatviswa504 I have tried to move the duplicate lines to separate
method and also perform other cleanups.
At the very least, the thread interrupt must be done in the catch block and
not in a separate method being called from the catch block. So, the
thread.interrupt() is the only line that cannot be avoided from being
duplicated.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]