pjfanning commented on code in PR #908:
URL: https://github.com/apache/pekko-management/pull/908#discussion_r3716433075


##########
management-cluster-bootstrap/src/main/scala/org/apache/pekko/management/cluster/bootstrap/SelfAwareJoinDecider.scala:
##########
@@ -47,13 +47,19 @@ import scala.concurrent.duration._
    * to HTTP binding, during 
[[pekko.management.scaladsl.PekkoManagement.start()]], hence we
    * accept blocking on this initialization. If no value is received, the 
future will fail with
    * a `TimeoutException` and ClusterBootstrap will log an explanatory error 
to the user.
+   *
+   * The result is cached after the first successful resolution to avoid 
repeated blocking.
    */
-  private[bootstrap] def selfContactPoint: (String, Int) =
-    Await.result(
+  @volatile private var cachedSelfContactPoint: Option[(String, Int)] = None

Review Comment:
   I changed it to a lazy val - I think it gives us good enough behaviour and 
reduces boilerplate



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to