Robustness of Cluster intialization
jastice opened this issue · comments
ClusterConnection has a blocking await call for connection initialization. On large clusters, with the default timeout (2s), this can fail because the nodes are initialized sequentially. The intialization can still complete succesfully because it happens asynchronously, but the ClusterConnection
object will not be instantiated
I'd like a more robust connection mechanism, possibly a factory to return a future that completes when cluster is initialized.
@jastice I am getting an error when initializing the cluster (see log attached), which I think might be related. However, looking at the code it seems like only one request is made to get all the slots? Why would large clusters be an issue?
[WARN] [10/31/2019 20:07:00.607] [campaign-audience-akka.actor.default-dispatcher-3] [EventStream(akka://scredis-2178)] Logger log1-Slf4jLogger did not respond within Timeout(15000 milliseconds) to InitializeLogger(bus) error while starting up loggers akka.ConfigurationException: Logger specified in config can't be loaded [akka.event.slf4j.Slf4jLogger] due to [akka.event.Logging$LoggerInitializationException: Logger log1-Slf4jLogger did not respond with LoggerInitialized, sent instead [TIMEOUT]] at akka.event.LoggingBus$$anonfun$$nestedInanonfun$startDefaultLoggers$3$1.applyOrElse(Logging.scala:122) at akka.event.LoggingBus$$anonfun$$nestedInanonfun$startDefaultLoggers$3$1.applyOrElse(Logging.scala:119) at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:34) at scala.util.Failure.recover(Try.scala:230) at akka.event.LoggingBus.$anonfun$startDefaultLoggers$3(Logging.scala:119) at scala.collection.TraversableLike$WithFilter.$anonfun$map$2(TraversableLike.scala:739) at scala.collection.Iterator.foreach(Iterator.scala:929) at scala.collection.Iterator.foreach$(Iterator.scala:929) at scala.collection.AbstractIterator.foreach(Iterator.scala:1417) at scala.collection.IterableLike.foreach(IterableLike.scala:71) at scala.collection.IterableLike.foreach$(IterableLike.scala:70) at scala.collection.AbstractIterable.foreach(Iterable.scala:54) at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:738) at akka.event.LoggingBus.startDefaultLoggers(Logging.scala:114) at akka.event.LoggingBus.startDefaultLoggers$(Logging.scala:100) at akka.event.EventStream.startDefaultLoggers(EventStream.scala:22) at akka.actor.LocalActorRefProvider.init(ActorRefProvider.scala:662) at akka.actor.ActorSystemImpl.liftedTree2$1(ActorSystem.scala:840) at akka.actor.ActorSystemImpl._start$lzycompute(ActorSystem.scala:837) at akka.actor.ActorSystemImpl._start(ActorSystem.scala:837) at akka.actor.ActorSystemImpl.start(ActorSystem.scala:856) at akka.actor.ActorSystem$.apply(ActorSystem.scala:246) at akka.actor.ActorSystem$.apply(ActorSystem.scala:289) at akka.actor.ActorSystem$.apply(ActorSystem.scala:234) at scredis.io.ClusterConnection.$anonfun$makeConnection$1(ClusterConnection.scala:114) at scala.Option.getOrElse(Option.scala:121) at scredis.io.ClusterConnection.makeConnection(ClusterConnection.scala:114) at scredis.io.ClusterConnection.$anonfun$send$1(ClusterConnection.scala:150)
Please keep conversation about your problem in issue you created.