sashapolo commented on code in PR #6136:
URL: https://github.com/apache/ignite-3/pull/6136#discussion_r2174598776


##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java:
##########
@@ -615,11 +613,21 @@ private <R extends NetworkMessage> CompletableFuture<R> 
sendWithRetry(
         ThrottlingContextHolder peerThrottlingContextHolder = 
throttlingContextHolder.peerContextHolder(peer.consistentId());
 
         if (throttleOnOverload && peerThrottlingContextHolder.isOverloaded()) {
-            executor.schedule(
-                    () -> future.completeExceptionally(new 
GroupOverloadedException(groupId, peer)),
-                    100,
-                    TimeUnit.MILLISECONDS
-            );
+            if (!busyLock.enterBusy()) {

Review Comment:
   Why do we take the lock only inside the `if`?



##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java:
##########
@@ -615,11 +613,21 @@ private <R extends NetworkMessage> CompletableFuture<R> 
sendWithRetry(
         ThrottlingContextHolder peerThrottlingContextHolder = 
throttlingContextHolder.peerContextHolder(peer.consistentId());
 
         if (throttleOnOverload && peerThrottlingContextHolder.isOverloaded()) {
-            executor.schedule(
-                    () -> future.completeExceptionally(new 
GroupOverloadedException(groupId, peer)),
-                    100,
-                    TimeUnit.MILLISECONDS
-            );
+            if (!busyLock.enterBusy()) {
+                
future.completeExceptionally(stoppingExceptionFactory.create("Raft client is 
stopping [" + groupId + "]."));
+
+                return future;
+            }
+
+            try {
+                executor.schedule(

Review Comment:
   I wonder what is happening here....



##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageManagerImpl.java:
##########
@@ -1179,13 +1179,17 @@ private <T> CompletableFuture<T> 
doWithOneOffRaftGroupService(
             RaftGroupService raftGroupService = 
raftMgr.startRaftGroupService(MetastorageGroupId.INSTANCE, 
raftClientConfiguration, true);
 
             return action.apply(raftGroupService)
-                    .whenComplete((res, ex) -> {
+                    // This callback should be executed asynchronously due to
+                    // its code might be done under a busyLock of the 
raftGroupService,
+                    // and so, it results in a deadlock on shutting down the 
service.
+                    // TODO: https://issues.apache.org/jira/browse/IGNITE-25787

Review Comment:
   I hope you will fix this soon, because this looks very weird



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to