ivandika3 commented on code in PR #1142:
URL: https://github.com/apache/ratis/pull/1142#discussion_r1756313357


##########
ratis-server/src/main/java/org/apache/ratis/server/storage/SnapshotManager.java:
##########
@@ -114,7 +115,8 @@ public void installSnapshot(InstallSnapshotRequestProto 
request, StateMachine st
 
     // TODO: Make sure that subsequent requests for the same installSnapshot 
are coming in order,
     // and are not lost when whole request cycle is done. Check requestId and 
requestIndex here
-
+    MessageDigest digester = newMd5Digest();
+    digester.reset();

Review Comment:
   Yes, instantiating a new digester is should also fine, but there might be 
more memory overhead and short lived objects compared to the ThreadLocal 
implementation (which might also be fine if the operation is infrequent).
   
   If the issue can be resolved by simply removing the `MemoizedSupplier`, I 
think we can consider this instead of instantiating a new digester every time.



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