You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/12/26 05:18:42 UTC

[GitHub] [spark] HeartSaVioR opened a new pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

HeartSaVioR opened a new pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010
 
 
   ### What changes were proposed in this pull request?
   
   This patch fixes flaky tests "master/worker web ui available" & "master/worker web ui available with reverseProxy" in MasterSuite.
   
   Tracking back from stack trace, I found there's possible race condition in `Dispatcher.registerRpcEndpoint()`:
   
   https://github.com/apache/spark/blob/481fb63f97d87d5b2e9e1f9b30bee466605b5a72/core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala#L64-L77
   
   `getMessageLoop()` initializes a new Inbox for this endpoint for both DedicatedMessageLoop 
    and SharedMessageLoop, which calls `onStart()`  "asynchronously" and "eventually" via posting `OnStart` message. `onStart()` will initialize UI page instance(s), so the execution of `endpointRefs.put()` and initializing UI page instance(s) are "concurrent".
   
   MasterPage and WorkerPage retrieve endpoint ref and store it as "val" assuming endpoint ref is valid when they're initialized - so in bad case they could store "null" as endpoint ref, and don't change.
   
   https://github.com/apache/spark/blob/481fb63f97d87d5b2e9e1f9b30bee466605b5a72/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala#L33-L38
   
   https://github.com/apache/spark/blob/481fb63f97d87d5b2e9e1f9b30bee466605b5a72/core/src/main/scala/org/apache/spark/deploy/worker/ui/WorkerPage.scala#L35-L41
   
   This patch simply adds loop to ensure endpoint ref is available when retrieving from MasterPage/WorkerPage, given the fact that endpoint ref assignment in Dispatcher won't take long.
   
   ### Why are the changes needed?
   
   We observed the test failures from Jenkins; below are the links:
   
   https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115583/testReport/
   https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115700/testReport/
   
   
   ### Does this PR introduce any user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Existing UTs. Unfortunately it's hard to reproduce as it's due to race condition and it barely fails.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r362877363
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +59,34 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.containsKey(name)) {
         throw new IllegalArgumentException(s"There is already an RpcEndpoint called $name")
       }
+
+      // This must be done before assigning RpcEndpoint to MessageLoop, as MessageLoop sets Inbox be
+      // active when registering, and endpointRef must be put into endpointRefs before onStart is
+      // called.
+      endpointRefs.put(endpoint, endpointRef)
+
+      var messageLoop: MessageLoop = null
+      try {
+        messageLoop = endpoint match {
+          case e: IsolatedRpcEndpoint =>
+            new DedicatedMessageLoop(name, e, this)
+          case _ =>
+            sharedLoop.register(name, endpoint)
+            sharedLoop
+        }
+        endpoints.put(name, messageLoop)
+      } catch {
+        case NonFatal(e) =>
+          endpointRefs.remove(endpoint)
+          if (messageLoop != null && messageLoop.isInstanceOf[DedicatedMessageLoop]) {
 
 Review comment:
   This will never happen, because if an exception is thrown, it will be in the `DedicatedMessageLoop` constructor, so `messageLoop` will still be `null`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r361370210
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/deploy/worker/ui/WorkerPage.scala
 ##########
 @@ -33,7 +33,12 @@ import org.apache.spark.ui.{UIUtils, WebUIPage}
 import org.apache.spark.util.Utils
 
 private[ui] class WorkerPage(parent: WorkerWebUI) extends WebUIPage("") {
-  private val workerEndpoint = parent.worker.self
+  private val workerEndpoint = {
 
 Review comment:
   Same here: if we don't feel comfortable adding infinite loop, we can just change it from val to def, with adding comment it shouldn't be cached.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r361370176
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/deploy/master/ui/MasterWebUI.scala
 ##########
 @@ -34,7 +34,12 @@ class MasterWebUI(
   extends WebUI(master.securityMgr, master.securityMgr.getSSLOptions("standalone"),
     requestedPort, master.conf, name = "MasterUI") with Logging {
 
-  val masterEndpointRef = master.self
+  val masterEndpointRef = {
 
 Review comment:
   If we don't feel comfortable adding infinite loop, we can just change it from val to def, with adding comment it shouldn't be cached.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570517528
 
 
   **[Test build #116090 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/116090/testReport)** for PR 27010 at commit [`8144b7d`](https://github.com/apache/spark/commit/8144b7d077e20d2542c96729dc848b2abd70afbb).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569149531
 
 
   Thanks for referring #26059. I took a look a bit, and found actual change relevant to this.
   
   Below is the implementation of `registerRpcEndpoint` before #26059:
   
   ```
     def registerRpcEndpoint(name: String, endpoint: RpcEndpoint): NettyRpcEndpointRef = {
       val addr = RpcEndpointAddress(nettyEnv.address, name)
       val endpointRef = new NettyRpcEndpointRef(nettyEnv.conf, addr, nettyEnv)
       synchronized {
         if (stopped) {
           throw new IllegalStateException("RpcEnv has been stopped")
         }
         if (endpoints.putIfAbsent(name, new EndpointData(name, endpoint, endpointRef)) != null) {
           throw new IllegalArgumentException(s"There is already an RpcEndpoint called $name")
         }
         val data = endpoints.get(name)
         endpointRefs.put(data.endpoint, data.ref)
         receivers.offer(data)  // for the OnStart message
       }
       endpointRef
     }
   ```
   
   According to the code comment, the code ensures onStart will be called "after" endpointRef is set to endpointRefs. Currently all the operations are done in getMessageLoop so we can't ensure it.
   
   Maybe SharedMessageLoop and DedicatedMessageLoop shouldn't set Inbox be active by itself, and let Dispatcher initiates it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570750404
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569152995
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20615/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569152989
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569170605
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/115824/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570557850
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r362071308
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +82,10 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.putIfAbsent(name, assignToMessageLoop(name, endpoint, endpointRef)) != null) {
 
 Review comment:
   While this solves the issue, I don't think it's quite right. The error path here is wrong, because you'll modify `endpointRefs` and, more importantly, the message loop. (`assignToMessageLoop` mutates those, and is called here regardless of whether the endpoint should be registered.)
   
   To be fair, the previous code also has that problem w.r.t. the message loop being modified.
   
   I think it would be safe here to have something like:
   
   ```
   def findMessageLoop(endpoint) = {
     // return the right message loop without modification
   }
   
   val messageLoop = findMessageLoop(endpoint)
   if (endpoints.putIfAbsent(name, messageLoop) != null) {
     throw
   }
   endpointRefs.put(...)
   messageLoop.register(...)
   ```
   
   If done inside the synchronized loop that seems to be safe and solve the problem. `DedicatedMessageLoop` should also implement `register` and call `setActive` there, instead of as part of the constructor. To add another small thing, `DedicatedMessageLoop` will leak a thread pool here in the error case, so maybe the thread pool should also be created in the `register` implementation.
   
   In fact... since this is inside a synchronized block anyway, you can simplify some of the above by not using `putIfAbsent`. Just check with `containsKey`, throw if it already exists, then find the right loop, put it in `endpoints` and update `endpointRefs`, then call `register()`. You'll still need `DedicatedMessageLoop.register()` to call `setActive()` at the right time.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] vanzin closed pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
vanzin closed pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569830121
 
 
   **[Test build #115976 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115976/testReport)** for PR 27010 at commit [`ac10f87`](https://github.com/apache/spark/commit/ac10f879cc44c1571a56ebc4d7d9871cc23b213c).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569170603
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570750407
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/116106/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-571361388
 
 
   Thanks for reviewing and merging!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570738045
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569830342
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20768/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570517966
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-571155247
 
 
   Looks like the related tests fail more frequently, seen two times in a PR (not sure why it seems to fail more frequently). Kindly reminder to handle this sooner.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569150131
 
 
   Btw, I found the bug can be reproduced consistently, via adding Thread.sleep(1000) just before endpointRefs.put(endpoint, endpointRef) in Dispatcher.registerRpcEndpoint(...). Also updated the same in the description of PR.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570750407
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/116106/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570750304
 
 
   **[Test build #116106 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/116106/testReport)** for PR 27010 at commit [`68fcd51`](https://github.com/apache/spark/commit/68fcd51bb384ed9c0cf6220ddedd9584af02d8fc).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569170605
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/115824/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569152730
 
 
   **[Test build #115823 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115823/testReport)** for PR 27010 at commit [`7bcdf29`](https://github.com/apache/spark/commit/7bcdf297c5057d48f64da5de6e09eb3d2dbf9e69).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569152915
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/115823/
   Test FAILed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570516067
 
 
   retest this, please

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r362117776
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +82,10 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.putIfAbsent(name, assignToMessageLoop(name, endpoint, endpointRef)) != null) {
 
 Review comment:
   > To be fair, the previous code also has that problem w.r.t. the message loop being modified.
   
   Yes, that's the reason I just put the band-aid there and rename the method as well. I tried to provide smallest change as the goal of patch is to just fix the thread-safety issue.
   
   But basically I totally agree about your suggestion, especially having `register` to DedicatedMessageLoop explicitly and not registering endpoint in `findMessageLoop`. Will reflect. Thanks for the suggestion.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570425309
 
 
   Merged build finished. Test FAILed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r362657699
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +66,27 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.containsKey(name)) {
         throw new IllegalArgumentException(s"There is already an RpcEndpoint called $name")
       }
+      val msgLoop = findMessageLoop(name, endpoint)
+      endpoints.put(name, msgLoop)
+      try {
+        endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   Thanks for confirming! Will make a change.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r361597144
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -44,13 +45,26 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
   private val shutdownLatch = new CountDownLatch(1)
   private lazy val sharedLoop = new SharedMessageLoop(nettyEnv.conf, this, numUsableCores)
 
-  private def getMessageLoop(name: String, endpoint: RpcEndpoint): MessageLoop = {
-    endpoint match {
-      case e: IsolatedRpcEndpoint =>
-        new DedicatedMessageLoop(name, e, this)
-      case _ =>
-        sharedLoop.register(name, endpoint)
-        sharedLoop
+  private def assignToMessageLoop(
+      name: String,
+      endpoint: RpcEndpoint,
+      endpointRef: RpcEndpointRef): MessageLoop = {
+    // This must be done before assigning RpcEndpoint to MessageLoop, as MessageLoop sets Inbox be
+    // active when registering, and endpointRef must be put into endpointRefs before onStart is
+    // called. Refer the doc of `RpcEndpoint.self`, as well as `NettyRpcEnv.endpointRef`.
+    endpointRefs.put(endpoint, endpointRef)
+    try {
+      endpoint match {
+        case e: IsolatedRpcEndpoint =>
+          new DedicatedMessageLoop(name, e, this)
+        case _ =>
+          sharedLoop.register(name, endpoint)
+          sharedLoop
+      }
+    } catch {
+      case NonFatal(e) =>
 
 Review comment:
   It could be various reasons as we do non-trivial operations here; but yes I haven't met and imagine any real case. That's defensive code, but this ensures the behavior is same as before when failing. (ref will not be registered in refs.)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570517528
 
 
   **[Test build #116090 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/116090/testReport)** for PR 27010 at commit [`8144b7d`](https://github.com/apache/spark/commit/8144b7d077e20d2542c96729dc848b2abd70afbb).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569153949
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569152989
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569153799
 
 
   **[Test build #115824 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115824/testReport)** for PR 27010 at commit [`fff5050`](https://github.com/apache/spark/commit/fff50508f3a27e5546cd98b5d135908ee44a1831).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r361594038
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -44,13 +45,26 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
   private val shutdownLatch = new CountDownLatch(1)
   private lazy val sharedLoop = new SharedMessageLoop(nettyEnv.conf, this, numUsableCores)
 
-  private def getMessageLoop(name: String, endpoint: RpcEndpoint): MessageLoop = {
-    endpoint match {
-      case e: IsolatedRpcEndpoint =>
-        new DedicatedMessageLoop(name, e, this)
-      case _ =>
-        sharedLoop.register(name, endpoint)
-        sharedLoop
+  private def assignToMessageLoop(
+      name: String,
+      endpoint: RpcEndpoint,
+      endpointRef: RpcEndpointRef): MessageLoop = {
+    // This must be done before assigning RpcEndpoint to MessageLoop, as MessageLoop sets Inbox be
+    // active when registering, and endpointRef must be put into endpointRefs before onStart is
+    // called. Refer the doc of `RpcEndpoint.self`, as well as `NettyRpcEnv.endpointRef`.
+    endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   If we can update `endpointRefs` here, could we also update `endpointRefs` above `getMessageLoop`/`assignToMessageLoop`?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-568973127
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r361594137
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -44,13 +45,26 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
   private val shutdownLatch = new CountDownLatch(1)
   private lazy val sharedLoop = new SharedMessageLoop(nettyEnv.conf, this, numUsableCores)
 
-  private def getMessageLoop(name: String, endpoint: RpcEndpoint): MessageLoop = {
-    endpoint match {
-      case e: IsolatedRpcEndpoint =>
-        new DedicatedMessageLoop(name, e, this)
-      case _ =>
-        sharedLoop.register(name, endpoint)
-        sharedLoop
+  private def assignToMessageLoop(
+      name: String,
+      endpoint: RpcEndpoint,
+      endpointRef: RpcEndpointRef): MessageLoop = {
+    // This must be done before assigning RpcEndpoint to MessageLoop, as MessageLoop sets Inbox be
+    // active when registering, and endpointRef must be put into endpointRefs before onStart is
+    // called. Refer the doc of `RpcEndpoint.self`, as well as `NettyRpcEnv.endpointRef`.
+    endpointRefs.put(endpoint, endpointRef)
+    try {
+      endpoint match {
+        case e: IsolatedRpcEndpoint =>
+          new DedicatedMessageLoop(name, e, this)
+        case _ =>
+          sharedLoop.register(name, endpoint)
+          sharedLoop
+      }
+    } catch {
+      case NonFatal(e) =>
 
 Review comment:
   When will we fail?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570395556
 
 
   **[Test build #116059 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/116059/testReport)** for PR 27010 at commit [`8144b7d`](https://github.com/apache/spark/commit/8144b7d077e20d2542c96729dc848b2abd70afbb).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570737797
 
 
   **[Test build #116106 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/116106/testReport)** for PR 27010 at commit [`68fcd51`](https://github.com/apache/spark/commit/68fcd51bb384ed9c0cf6220ddedd9584af02d8fc).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570425107
 
 
   **[Test build #116059 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/116059/testReport)** for PR 27010 at commit [`8144b7d`](https://github.com/apache/spark/commit/8144b7d077e20d2542c96729dc848b2abd70afbb).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570395963
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20851/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569153059
 
 
   I just changed the approach; please take a look. The idea is that endpoint should be only accessed by endpoint ref after the call of registerRpcEndpoint; only exception is referring ref in onStart. So it's safe to put endpoint ref earlier than assigning to message loop, and remove when assign to message loop fails.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569153949
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570425309
 
 
   Merged build finished. Test FAILed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-568972915
 
 
   **[Test build #115790 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115790/testReport)** for PR 27010 at commit [`223c466`](https://github.com/apache/spark/commit/223c46688bee6c8d237ae88d9ef5cd56abf45c39).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569004218
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569152915
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/115823/
   Test FAILed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569830121
 
 
   **[Test build #115976 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115976/testReport)** for PR 27010 at commit [`ac10f87`](https://github.com/apache/spark/commit/ac10f879cc44c1571a56ebc4d7d9871cc23b213c).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r362657084
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +66,27 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.containsKey(name)) {
         throw new IllegalArgumentException(s"There is already an RpcEndpoint called $name")
       }
+      val msgLoop = findMessageLoop(name, endpoint)
+      endpoints.put(name, msgLoop)
+      try {
+        endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   Hmm, I can't find a way to see the complete patch at a specific commit in the UI, so I'll say "maybe".
   
   The goal is:
   - not modify "endpoints" when checking if the endpoint exists
   - update "endpointRefs" before registering the endpoint's message loop (calling `register` in the case of the shared loop, or creating the dedicated message loop)
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569152910
 
 
   Merged build finished. Test FAILed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r361598001
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -44,13 +45,26 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
   private val shutdownLatch = new CountDownLatch(1)
   private lazy val sharedLoop = new SharedMessageLoop(nettyEnv.conf, this, numUsableCores)
 
-  private def getMessageLoop(name: String, endpoint: RpcEndpoint): MessageLoop = {
-    endpoint match {
-      case e: IsolatedRpcEndpoint =>
-        new DedicatedMessageLoop(name, e, this)
-      case _ =>
-        sharedLoop.register(name, endpoint)
-        sharedLoop
+  private def assignToMessageLoop(
+      name: String,
+      endpoint: RpcEndpoint,
+      endpointRef: RpcEndpointRef): MessageLoop = {
+    // This must be done before assigning RpcEndpoint to MessageLoop, as MessageLoop sets Inbox be
+    // active when registering, and endpointRef must be put into endpointRefs before onStart is
+    // called. Refer the doc of `RpcEndpoint.self`, as well as `NettyRpcEnv.endpointRef`.
+    endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   Sorry I don't get it. Could you elaborate? If you meant creating endpointRef here, that would be simple to do but either we need to have tuple of return type or registerRpcEndpoint should get endpointRef from endpointRefs, looks like no big advantage.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r362999859
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +59,34 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.containsKey(name)) {
         throw new IllegalArgumentException(s"There is already an RpcEndpoint called $name")
       }
+
+      // This must be done before assigning RpcEndpoint to MessageLoop, as MessageLoop sets Inbox be
+      // active when registering, and endpointRef must be put into endpointRefs before onStart is
+      // called.
+      endpointRefs.put(endpoint, endpointRef)
+
+      var messageLoop: MessageLoop = null
+      try {
+        messageLoop = endpoint match {
+          case e: IsolatedRpcEndpoint =>
+            new DedicatedMessageLoop(name, e, this)
+          case _ =>
+            sharedLoop.register(name, endpoint)
+            sharedLoop
+        }
+        endpoints.put(name, messageLoop)
+      } catch {
+        case NonFatal(e) =>
+          endpointRefs.remove(endpoint)
+          if (messageLoop != null && messageLoop.isInstanceOf[DedicatedMessageLoop]) {
 
 Review comment:
   You're right. I'll remove it. 
   
   Btw, do we decide to just ignore leaking thread pool? The previous change I reverted was required to deal with it, as thread pool shouldn't be initialized in constructor. I guess it might be yes, as you've mentioned it as "small thing", but that's only the matter of git rebase so please let me know if we would want to address it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569849121
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569153951
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20616/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r362656055
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +66,27 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.containsKey(name)) {
         throw new IllegalArgumentException(s"There is already an RpcEndpoint called $name")
       }
+      val msgLoop = findMessageLoop(name, endpoint)
+      endpoints.put(name, msgLoop)
+      try {
+        endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   Just to confirm, that's pretty much close with the patch before ac10f87 (that commit was to reflect review comment), with the additional changes; to use containsKey/put instead of putIfAbsent, and inline getMessageLoop. Could you confirm?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r363002663
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +59,34 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.containsKey(name)) {
         throw new IllegalArgumentException(s"There is already an RpcEndpoint called $name")
       }
+
+      // This must be done before assigning RpcEndpoint to MessageLoop, as MessageLoop sets Inbox be
+      // active when registering, and endpointRef must be put into endpointRefs before onStart is
+      // called.
+      endpointRefs.put(endpoint, endpointRef)
+
+      var messageLoop: MessageLoop = null
+      try {
+        messageLoop = endpoint match {
+          case e: IsolatedRpcEndpoint =>
+            new DedicatedMessageLoop(name, e, this)
+          case _ =>
+            sharedLoop.register(name, endpoint)
+            sharedLoop
+        }
+        endpoints.put(name, messageLoop)
+      } catch {
+        case NonFatal(e) =>
+          endpointRefs.remove(endpoint)
+          if (messageLoop != null && messageLoop.isInstanceOf[DedicatedMessageLoop]) {
 
 Review comment:
   If anything fails in that constructor, it will be the creation of the thread pool itself, so I don't think anything would leak. Also if that fails, we have bigger problems anyway.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569848946
 
 
   **[Test build #115976 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115976/testReport)** for PR 27010 at commit [`ac10f87`](https://github.com/apache/spark/commit/ac10f879cc44c1571a56ebc4d7d9871cc23b213c).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r362657084
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +66,27 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.containsKey(name)) {
         throw new IllegalArgumentException(s"There is already an RpcEndpoint called $name")
       }
+      val msgLoop = findMessageLoop(name, endpoint)
+      endpoints.put(name, msgLoop)
+      try {
+        endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   Hmm, I can't find a wait to see the complete patch at a specific commit in the UI, so I'll say "maybe".
   
   The goal is:
   - not modify "endpoints" when checking if the endpoint exists
   - update "endpointRefs" before registering the endpoint's message loop (calling `register` in the case of the shared loop, or creating the dedicated message loop)
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569830342
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20768/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r361598648
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -44,13 +45,26 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
   private val shutdownLatch = new CountDownLatch(1)
   private lazy val sharedLoop = new SharedMessageLoop(nettyEnv.conf, this, numUsableCores)
 
-  private def getMessageLoop(name: String, endpoint: RpcEndpoint): MessageLoop = {
-    endpoint match {
-      case e: IsolatedRpcEndpoint =>
-        new DedicatedMessageLoop(name, e, this)
-      case _ =>
-        sharedLoop.register(name, endpoint)
-        sharedLoop
+  private def assignToMessageLoop(
+      name: String,
+      endpoint: RpcEndpoint,
+      endpointRef: RpcEndpointRef): MessageLoop = {
+    // This must be done before assigning RpcEndpoint to MessageLoop, as MessageLoop sets Inbox be
+    // active when registering, and endpointRef must be put into endpointRefs before onStart is
+    // called. Refer the doc of `RpcEndpoint.self`, as well as `NettyRpcEnv.endpointRef`.
+    endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   Ok, never mind. I got why you do this(`endpointRefs.put(endpoint, endpointRef)`) in `assignToMessageLoop()`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-568972915
 
 
   **[Test build #115790 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115790/testReport)** for PR 27010 at commit [`223c466`](https://github.com/apache/spark/commit/223c46688bee6c8d237ae88d9ef5cd56abf45c39).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570738048
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20898/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570395556
 
 
   **[Test build #116059 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/116059/testReport)** for PR 27010 at commit [`8144b7d`](https://github.com/apache/spark/commit/8144b7d077e20d2542c96729dc848b2abd70afbb).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569153799
 
 
   **[Test build #115824 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115824/testReport)** for PR 27010 at commit [`fff5050`](https://github.com/apache/spark/commit/fff50508f3a27e5546cd98b5d135908ee44a1831).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570395956
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569170603
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569152910
 
 
   Merged build finished. Test FAILed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570425317
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/116059/
   Test FAILed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569830340
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569004218
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570425317
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/116059/
   Test FAILed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570750404
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570557853
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/116090/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569004255
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/115790/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569849125
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/115976/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570517966
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569498633
 
 
   cc. @vanzin @zsxwing 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569830340
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570557444
 
 
   **[Test build #116090 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/116090/testReport)** for PR 27010 at commit [`8144b7d`](https://github.com/apache/spark/commit/8144b7d077e20d2542c96729dc848b2abd70afbb).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r361599995
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -44,13 +45,26 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
   private val shutdownLatch = new CountDownLatch(1)
   private lazy val sharedLoop = new SharedMessageLoop(nettyEnv.conf, this, numUsableCores)
 
-  private def getMessageLoop(name: String, endpoint: RpcEndpoint): MessageLoop = {
-    endpoint match {
-      case e: IsolatedRpcEndpoint =>
-        new DedicatedMessageLoop(name, e, this)
-      case _ =>
-        sharedLoop.register(name, endpoint)
-        sharedLoop
+  private def assignToMessageLoop(
+      name: String,
+      endpoint: RpcEndpoint,
+      endpointRef: RpcEndpointRef): MessageLoop = {
+    // This must be done before assigning RpcEndpoint to MessageLoop, as MessageLoop sets Inbox be
+    // active when registering, and endpointRef must be put into endpointRefs before onStart is
+    // called. Refer the doc of `RpcEndpoint.self`, as well as `NettyRpcEnv.endpointRef`.
+    endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   Yes, that's for doing only when putIfAbsent runs code for "absent".

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569849121
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570517976
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20883/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569004255
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/115790/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-568973127
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570395956
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569170344
 
 
   **[Test build #115824 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115824/testReport)** for PR 27010 at commit [`fff5050`](https://github.com/apache/spark/commit/fff50508f3a27e5546cd98b5d135908ee44a1831).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570517976
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20883/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569849125
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/115976/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569152995
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20615/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r362656055
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +66,27 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.containsKey(name)) {
         throw new IllegalArgumentException(s"There is already an RpcEndpoint called $name")
       }
+      val msgLoop = findMessageLoop(name, endpoint)
+      endpoints.put(name, msgLoop)
+      try {
+        endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   Just to confirm, that's pretty much close with the patch before ac10f87 (that commit was to reflect review comment), with the additional changes; to use containsKey/put instead of putIfAbsent, and inline `getMessageLoop` (`assignToMessageLoop` before ac10f87 but name doesn't matter as we will inline). Could you confirm?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
vanzin commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r362651134
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +66,27 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.containsKey(name)) {
         throw new IllegalArgumentException(s"There is already an RpcEndpoint called $name")
       }
+      val msgLoop = findMessageLoop(name, endpoint)
+      endpoints.put(name, msgLoop)
+      try {
+        endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   Hmm. This is all correct but feels a bit overkill. Seems like a simpler version would be:
   
   ```
   endpointRefs.put(endpoint, endpointRef)
   try {
     endpoints.put(name, getMessageLoop(name, endpoint))
   } catch {
     // cleanup endpointRefs
   }
   ```
   
   Yes, that uses the old `getMessageLoop()` (which could be inlined here for clarity), but that's ok as long as it's done after the `containsKey` check. Then you don't even need the changes to the other file.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570557853
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/116090/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-568973131
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20584/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569152730
 
 
   **[Test build #115823 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115823/testReport)** for PR 27010 at commit [`7bcdf29`](https://github.com/apache/spark/commit/7bcdf297c5057d48f64da5de6e09eb3d2dbf9e69).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r361600186
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -44,13 +45,26 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
   private val shutdownLatch = new CountDownLatch(1)
   private lazy val sharedLoop = new SharedMessageLoop(nettyEnv.conf, this, numUsableCores)
 
-  private def getMessageLoop(name: String, endpoint: RpcEndpoint): MessageLoop = {
-    endpoint match {
-      case e: IsolatedRpcEndpoint =>
-        new DedicatedMessageLoop(name, e, this)
-      case _ =>
-        sharedLoop.register(name, endpoint)
-        sharedLoop
+  private def assignToMessageLoop(
+      name: String,
+      endpoint: RpcEndpoint,
+      endpointRef: RpcEndpointRef): MessageLoop = {
+    // This must be done before assigning RpcEndpoint to MessageLoop, as MessageLoop sets Inbox be
+    // active when registering, and endpointRef must be put into endpointRefs before onStart is
+    // called. Refer the doc of `RpcEndpoint.self`, as well as `NettyRpcEnv.endpointRef`.
+    endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   you read my mind.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569153951
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20616/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570395963
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20851/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-568973131
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20584/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-568973827
 
 
   Hmm... Does it mean the comment in below is broken? The code comment says `self` will become valid when `onStart` is called, but that doesn't seem to be true - self will become valid "around" when onStart is called and there's no guarantee that self is valid in onStart.
   
   https://github.com/apache/spark/blob/481fb63f97d87d5b2e9e1f9b30bee466605b5a72/core/src/main/scala/org/apache/spark/rpc/RpcEndpoint.scala#L53-L63

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570737797
 
 
   **[Test build #116106 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/116106/testReport)** for PR 27010 at commit [`68fcd51`](https://github.com/apache/spark/commit/68fcd51bb384ed9c0cf6220ddedd9584af02d8fc).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] vanzin commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
vanzin commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-571212194
 
 
   Merging to master.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569003094
 
 
   **[Test build #115790 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115790/testReport)** for PR 27010 at commit [`223c466`](https://github.com/apache/spark/commit/223c46688bee6c8d237ae88d9ef5cd56abf45c39).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570738045
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r361597144
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -44,13 +45,26 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
   private val shutdownLatch = new CountDownLatch(1)
   private lazy val sharedLoop = new SharedMessageLoop(nettyEnv.conf, this, numUsableCores)
 
-  private def getMessageLoop(name: String, endpoint: RpcEndpoint): MessageLoop = {
-    endpoint match {
-      case e: IsolatedRpcEndpoint =>
-        new DedicatedMessageLoop(name, e, this)
-      case _ =>
-        sharedLoop.register(name, endpoint)
-        sharedLoop
+  private def assignToMessageLoop(
+      name: String,
+      endpoint: RpcEndpoint,
+      endpointRef: RpcEndpointRef): MessageLoop = {
+    // This must be done before assigning RpcEndpoint to MessageLoop, as MessageLoop sets Inbox be
+    // active when registering, and endpointRef must be put into endpointRefs before onStart is
+    // called. Refer the doc of `RpcEndpoint.self`, as well as `NettyRpcEnv.endpointRef`.
+    endpointRefs.put(endpoint, endpointRef)
+    try {
+      endpoint match {
+        case e: IsolatedRpcEndpoint =>
+          new DedicatedMessageLoop(name, e, this)
+        case _ =>
+          sharedLoop.register(name, endpoint)
+          sharedLoop
+      }
+    } catch {
+      case NonFatal(e) =>
 
 Review comment:
   It could be various reasons as we do non-trivial operations here; but yes I haven't met and imagine any real case. That's defensive code, but this ensures the behavior is same when failing. (ref will not be registered in refs.)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570557850
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#discussion_r362664667
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala
 ##########
 @@ -68,11 +66,27 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv, numUsableCores: Int) exte
       if (stopped) {
         throw new IllegalStateException("RpcEnv has been stopped")
       }
-      if (endpoints.putIfAbsent(name, getMessageLoop(name, endpoint)) != null) {
+      if (endpoints.containsKey(name)) {
         throw new IllegalArgumentException(s"There is already an RpcEndpoint called $name")
       }
+      val msgLoop = findMessageLoop(name, endpoint)
+      endpoints.put(name, msgLoop)
+      try {
+        endpointRefs.put(endpoint, endpointRef)
 
 Review comment:
   Addressed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-570738048
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/20898/
   Test PASSed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27010: [SPARK-30313][CORE] Ensure EndpointRef is available MasterWebUI/WorkerPage
URL: https://github.com/apache/spark/pull/27010#issuecomment-569152903
 
 
   **[Test build #115823 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/115823/testReport)** for PR 27010 at commit [`7bcdf29`](https://github.com/apache/spark/commit/7bcdf297c5057d48f64da5de6e09eb3d2dbf9e69).
    * This patch **fails Scala style tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org