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



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java
##########
@@ -59,7 +59,7 @@
 
   private final Class<? extends Channel> channelClass;
 
-  private AsyncFSOutput output;
+  private volatile AsyncFSOutput output;

Review comment:
       In practise, as we will call getSyncedLength in another thread, it is 
possible that we call getSyncedLength on a closed writer. Maybe we could 
introduce another field to save the final length of the file, and in 
getSyncedLength, we check whether we have this field set, if so we just return 
the value of this field, otherwise we will go to get output. WDYT?




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


Reply via email to