szetszwo commented on code in PR #1151:
URL: https://github.com/apache/ratis/pull/1151#discussion_r1760979871


##########
ratis-server/src/main/java/org/apache/ratis/server/storage/SnapshotManager.java:
##########
@@ -87,7 +89,7 @@ private FileChannel open(FileChunkProto chunk, File 
tmpSnapshotFile) throws IOEx
       }
       // create the temp snapshot file and put padding inside
       out = FileUtils.newFileChannel(tmpSnapshotFile, 
StandardOpenOption.WRITE, StandardOpenOption.CREATE);
-      digester = MD5Hash.newDigester();
+      digester.set(MD5Hash.getDigester());

Review Comment:
   @133tosakarin , why changing back to `getDigester`?



##########
ratis-server/src/main/java/org/apache/ratis/server/storage/SnapshotManager.java:
##########
@@ -62,7 +63,7 @@ public class SnapshotManager {
   private final Supplier<File> snapshotDir;
   private final Supplier<File> snapshotTmpDir;
   private final Function<FileChunkProto, String> getRelativePath;
-  private MessageDigest digester;
+  private final AtomicReference<MessageDigest> digester;

Review Comment:
   How about simply add a `volatile`?
   
   



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

Reply via email to