commit | 204c7bf4354e1e53a9e4456404f9783e123b93ee | [log] [tgz] |
---|---|---|
author | Jordan Halterman <jordan@opennetworking.org> | Tue Aug 21 13:56:10 2018 -0700 |
committer | Thomas Vachuska <tom@opennetworking.org> | Tue Aug 28 16:51:43 2018 +0000 |
tree | 6e9d6d11020d1936e3c0d1286c0c875063dde0a2 | |
parent | 61289c10569c726d80be1789642029b589ddabcb [diff] |
Make leadership/mastership failover timeouts configurable Change-Id: I5e45085205ef3025d947ba69b3a122d41315b828
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixLeaderElectorBuilder.java b/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixLeaderElectorBuilder.java index 5546892..ef19b70 100644 --- a/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixLeaderElectorBuilder.java +++ b/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixLeaderElectorBuilder.java
@@ -15,6 +15,8 @@ */ package org.onosproject.store.atomix.primitives.impl; +import java.time.Duration; + import io.atomix.core.Atomix; import io.atomix.primitive.Recovery; import io.atomix.protocols.raft.MultiRaftProtocol; @@ -46,6 +48,7 @@ .withProtocol(MultiRaftProtocol.builder(group) .withRecoveryStrategy(Recovery.RECOVER) .withMaxRetries(MAX_RETRIES) + .withMaxTimeout(Duration.ofMillis(electionTimeoutMillis())) .build()) .withReadOnly(readOnly()) .withCacheEnabled(relaxedReadConsistency())