Fix NPE due to initialization order, see #2473
This commit is contained in:
parent
6e4b0dc3de
commit
806b5efcdf
1 changed files with 3 additions and 1 deletions
|
|
@ -149,7 +149,9 @@ class Cluster(val system: ExtendedActorSystem, val failureDetector: FailureDetec
|
|||
/**
|
||||
* INTERNAL API
|
||||
*/
|
||||
private[cluster] val clusterCore: ActorRef = {
|
||||
private[cluster] lazy val clusterCore: ActorRef = {
|
||||
// this val must be lazy for correct initialization order,
|
||||
// ClusterDaemon children may use for example subscribe before we get the GetClusterCoreRef reply
|
||||
implicit val timeout = system.settings.CreationTimeout
|
||||
Await.result((clusterDaemons ? InternalClusterAction.GetClusterCoreRef).mapTo[ActorRef], timeout.duration)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue