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

   ## What changes were proposed in this pull request?
   
   In `GrpcLogAppender`, it waits for signal at the end of 
`notifyInstallSnapshot` as following.
   
https://github.com/apache/ratis/blob/master/ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java#L825-L831
   However, checking whether the `InstallSnapshotResponseHandler` is done and 
the call `AwaitForSignal.await()` are not atomic. This creates a potential race 
condition where InstallSnapshotResponseHandler.close() could finish after the 
check but before the wait, causing that `GrpcLogAppender` is still waiting even 
though `InstallSnapshotResponseHandler` has already completed, leading to 
timeout. 
   
   Things change in the patch:
   Move the done check inside the lock in AwaitForSignal to ensure atomicity.
   
   ## What is the link to the Apache JIRA
   
   [RATIS-2152](https://issues.apache.org/jira/browse/RATIS-2152)
   
   Please replace this section with the link to the Apache JIRA)
   
   ## How was this patch tested?
   
   CI:
   https://github.com/chungen0126/ratis/actions/runs/10771583301
   
   


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