You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by am...@apache.org on 2022/12/21 10:47:48 UTC
[ignite-3] 03/06: wip. init raft group in a background.
This is an automated email from the ASF dual-hosted git repository.
amashenkov pushed a commit to branch ignite-18323
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit f7b5e3ef73a089d10073f3cec16fe0d192ed6e9c
Author: amashenkov <an...@gmail.com>
AuthorDate: Tue Dec 20 16:08:29 2022 +0300
wip. init raft group in a background.
---
.../ignite/internal/raft/RaftGroupServiceImpl.java | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java b/modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java
index cfd1817392..9e558c75c0 100644
--- a/modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java
+++ b/modules/raft/src/main/java/org/apache/ignite/internal/raft/RaftGroupServiceImpl.java
@@ -181,21 +181,14 @@ public class RaftGroupServiceImpl implements RaftGroupService {
return CompletableFuture.completedFuture(service);
}
- return service.refreshLeader().handle((unused, throwable) -> {
- if (throwable != null) {
- if (throwable.getCause() instanceof TimeoutException) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Failed to refresh a leader [groupId={}]", groupId);
- }
- } else {
- if (LOG.isWarnEnabled()) {
- LOG.warn("Failed to refresh a leader [groupId={}]", throwable, groupId);
- }
- }
+ service.refreshLeader().exceptionally((throwable) -> {
+ if (throwable != null && LOG.isWarnEnabled()) {
+ LOG.warn("Failed to refresh a leader [groupId={}]", throwable, groupId);
}
-
- return service;
+ return null;
});
+
+ return CompletableFuture.completedFuture(service);
}
/**