symious commented on code in PR #1081:
URL: https://github.com/apache/ratis/pull/1081#discussion_r1593293449


##########
ratis-server/src/main/java/org/apache/ratis/server/raftlog/RaftLogBase.java:
##########
@@ -516,20 +514,11 @@ public LogEntryProto getEntry(TimeDuration timeout) 
throws RaftLogIOException, T
       if (LogProtoUtils.isStateMachineDataEmpty(entryProto)) {
         final String err = getName() + ": State machine data not set for " + 
this;
         LOG.error(err);
-        data.release();
         throw new RaftLogIOException(err);

Review Comment:
   For this exception, I was thinking of such a scenario:
   
   1. In `List<LogEntryProto> protos = buffer.pollList(...)`, if `buffer` has 
10 records, and `pollList` has finished polling 7 records, on the 8th record, 
it reaches this RaftLogIOException().
   2. In outer finally, the leftover 3 records will be cleaned and removed, but 
the polled 7 records won't be released.



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