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