imbajin commented on code in PR #2871:
URL: https://github.com/apache/hugegraph/pull/2871#discussion_r4104414272


##########
hugegraph-store/hg-store-core/src/main/java/org/apache/hugegraph/store/raft/PartitionStateMachine.java:
##########
@@ -105,6 +106,9 @@ public void onApply(Iterator iter) {
                               done.getOperation().getOp(),
                               done.getOperation().getReq());
                 }
+                iter.setErrorAndRollback(1, new 
Status(RaftError.ESTATEMACHINE, t.getMessage()));

Review Comment:
   ⚠️ `Status(RaftError, String, Object...)` formats its second argument with 
`String.format`. If `t.getMessage()` contains `%s` or ends in `%`, construction 
throws before `setErrorAndRollback()` runs, so JRaft does not receive the 
intended iterator error; the PD catch uses the same call. Please pass the 
message as data (for example, `new Status(RaftError.ESTATEMACHINE, "%s", 
t.getMessage())`) in both state machines.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to