smengcl opened a new pull request, #1632:
URL: https://github.com/apache/ratis/pull/1632

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   A write sent with a replication level other than MAJORITY, for example 
`client.async().send(message, ReplicationLevel.ALL_COMMITTED)`, never succeeds. 
After the write is applied, `RaftServerImpl.waitForReplication` builds an 
internal watch request without a message, and the dummy request check that 
RATIS-2497 added to `RaftServerImpl.watchAsync` calls 
`request.getMessage().getContent()` on it. The leader throws a 
NullPointerException, and the client keeps retrying according to its retry 
policy.
   
   `RaftServerImpl` already has a null safe version of that check, 
`isDummyRead`, used on the read path. This change uses it in `watchAsync` as 
well and renames it to `isDummy`.
   
   `RaftAsyncTests.testWriteAsyncCustomReplicationLevel` did not catch this 
because it never waited for the futures returned by `send`. The client was 
closed before any reply arrived, every future completed with 
`AlreadyClosedException`, and the callback only logged it. The test now waits 
for each reply and fails on an exception.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/RATIS-2734
   
   ## How was this patch tested?
   
   `testWriteAsyncCustomReplicationLevel` with the stricter assertions fails 
without the fix and passes with it in `TestRaftAsyncWithGrpc`, 
`TestRaftAsyncWithGrpcTracing` and `TestRaftAsyncWithNetty`. 
`TestLinearizableReadWithGrpc` passes with the renamed check.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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