{"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka/pulls/comments/28043900","id":28043900,"diff_hunk":"@@ -0,0 +1,102 @@\n+/**\n+ * Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>\n+ */\n+\n+package akka.contrib.pattern\n+\n+import language.postfixOps\n+import scala.collection.immutable\n+import scala.concurrent.duration._\n+import com.typesafe.config.ConfigFactory\n+import akka.actor.Actor\n+import akka.actor.ActorLogging\n+import akka.actor.ActorRef\n+import akka.actor.Address\n+import akka.actor.Props\n+import akka.actor.PoisonPill\n+import akka.actor.RootActorPath\n+import akka.cluster.Cluster\n+import akka.cluster.ClusterEvent._\n+import akka.cluster.Member\n+import akka.remote.testconductor.RoleName\n+import akka.remote.testkit.MultiNodeConfig\n+import akka.remote.testkit.MultiNodeSpec\n+import akka.remote.testkit.STMultiNodeSpec\n+import akka.testkit._\n+import akka.testkit.TestEvent._\n+import akka.actor.Terminated\n+import akka.actor.ActorSelection\n+\n+object ClusterSingletonManagerStartupSpec extends MultiNodeConfig {\n+  val first = role(\"first\")\n+  val second = role(\"second\")\n+  val third = role(\"third\")\n+\n+  commonConfig(ConfigFactory.parseString(\"\"\"\n+    akka.loglevel = INFO\n+    akka.actor.provider = \"akka.cluster.ClusterActorRefProvider\"\n+    akka.remote.log-remote-lifecycle-events = off\n+    akka.cluster.auto-down-unreachable-after = 0s\n+    \"\"\"))\n+\n+  case object EchoStarted\n+  /**\n+   * The singleton actor\n+   */\n+  class Echo(testActor: ActorRef) extends Actor {\n+    def receive = {\n+      case _ ⇒\n+        sender() ! self\n+    }\n+  }\n+}\n+\n+class ClusterSingletonManagerStartupMultiJvmNode1 extends ClusterSingletonManagerStartupSpec\n+class ClusterSingletonManagerStartupMultiJvmNode2 extends ClusterSingletonManagerStartupSpec\n+class ClusterSingletonManagerStartupMultiJvmNode3 extends ClusterSingletonManagerStartupSpec\n+\n+class ClusterSingletonManagerStartupSpec extends MultiNodeSpec(ClusterSingletonManagerStartupSpec) with STMultiNodeSpec with ImplicitSender {\n+  import ClusterSingletonManagerStartupSpec._\n+\n+  override def initialParticipants = roles.size\n+\n+  def join(from: RoleName, to: RoleName): Unit = {\n+    runOn(from) {\n+      Cluster(system) join node(to).address\n+      createSingleton()\n+    }\n+  }\n+\n+  def createSingleton(): ActorRef = {\n+    system.actorOf(ClusterSingletonManager.props(\n+      singletonProps = Props(classOf[Echo], testActor),\n+      singletonName = \"echo\",\n+      terminationMessage = PoisonPill,\n+      role = None),\n+      name = \"singleton\")\n+  }\n+\n+  lazy val echoProxy: ActorRef = {\n+    system.actorOf(ClusterSingletonProxy.props(\n+      singletonPath = \"/user/singleton/echo\",\n+      role = None),\n+      name = \"echoProxy\")\n+  }\n+\n+  \"Startup of Cluster Singleton\" must {\n+\n+    \"be quick\" in {\n+      join(first, first)\n+      join(second, first)\n+      join(third, first)\n+\n+      runOn(first) {\n+        echoProxy ! \"hello\"\n+        expectMsgType[ActorRef](10.seconds)","path":"akka-contrib/src/multi-jvm/scala/akka/contrib/pattern/ClusterSingletonManagerStartupSpec.scala","position":95,"original_position":95,"commit_id":"dcb4e636850a1c01a1c233e349407e9d625f58af","original_commit_id":"dcb4e636850a1c01a1c233e349407e9d625f58af","user":{"login":"rkuhn","id":470469,"avatar_url":"https://avatars.githubusercontent.com/u/470469?v=3","gravatar_id":"","url":"https://api.github.com/users/rkuhn","html_url":"https://github.com/rkuhn","followers_url":"https://api.github.com/users/rkuhn/followers","following_url":"https://api.github.com/users/rkuhn/following{/other_user}","gists_url":"https://api.github.com/users/rkuhn/gists{/gist_id}","starred_url":"https://api.github.com/users/rkuhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkuhn/subscriptions","organizations_url":"https://api.github.com/users/rkuhn/orgs","repos_url":"https://api.github.com/users/rkuhn/repos","events_url":"https://api.github.com/users/rkuhn/events{/privacy}","received_events_url":"https://api.github.com/users/rkuhn/received_events","type":"User","site_admin":false},"body":"why can it take 10 seconds? what exactly would “being slow” mean in terms of timeout?","created_at":"2015-04-09T08:36:16Z","updated_at":"2015-04-09T08:36:16Z","html_url":"https://github.com/akka/akka/pull/17154#discussion_r28043900","pull_request_url":"https://api.github.com/repos/akka/akka/pulls/17154","_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/28043900"},"html":{"href":"https://github.com/akka/akka/pull/17154#discussion_r28043900"},"pull_request":{"href":"https://api.github.com/repos/akka/akka/pulls/17154"}}},"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/17154","id":32851915,"html_url":"https://github.com/akka/akka/pull/17154","diff_url":"https://github.com/akka/akka/pull/17154.diff","patch_url":"https://github.com/akka/akka/pull/17154.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/17154","number":17154,"state":"open","locked":false,"title":"=con #13869 Speedup startup of Cluster singleton","user":{"login":"patriknw","id":336161,"avatar_url":"https://avatars.githubusercontent.com/u/336161?v=3","gravatar_id":"","url":"https://api.github.com/users/patriknw","html_url":"https://github.com/patriknw","followers_url":"https://api.github.com/users/patriknw/followers","following_url":"https://api.github.com/users/patriknw/following{/other_user}","gists_url":"https://api.github.com/users/patriknw/gists{/gist_id}","starred_url":"https://api.github.com/users/patriknw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patriknw/subscriptions","organizations_url":"https://api.github.com/users/patriknw/orgs","repos_url":"https://api.github.com/users/patriknw/repos","events_url":"https://api.github.com/users/patriknw/events{/privacy}","received_events_url":"https://api.github.com/users/patriknw/received_events","type":"User","site_admin":false},"body":"* avoid the hand-over/take-over attempts when starting the\r\n  ClusterSingletonManager for the normal clase when the cluster is\r\n  in a good shape, i.e. no exiting member that might run previous\r\n  singleton instance","created_at":"2015-04-08T11:45:15Z","updated_at":"2015-04-09T08:36:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d36b90efe30b2ace8c4d6dfafacbd439623bd3e6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/17154/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/17154/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akka/akka/issues/17154/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/dcb4e636850a1c01a1c233e349407e9d625f58af","head":{"label":"akka:wip-13869-cluster-singleton-speedup-patriknw","ref":"wip-13869-cluster-singleton-speedup-patriknw","sha":"dcb4e636850a1c01a1c233e349407e9d625f58af","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","created_at":"2009-02-16T12:51:54Z","updated_at":"2015-04-09T02:41:35Z","pushed_at":"2015-04-09T06:02:10Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":244778,"stargazers_count":3781,"watchers_count":3781,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1084,"mirror_url":null,"open_issues_count":650,"forks":1084,"open_issues":650,"watchers":3781,"default_branch":"master"}},"base":{"label":"akka:master","ref":"master","sha":"ea2219950d62faf46c85f433e55a45b0aeaa1c88","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","created_at":"2009-02-16T12:51:54Z","updated_at":"2015-04-09T02:41:35Z","pushed_at":"2015-04-09T06:02:10Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":244778,"stargazers_count":3781,"watchers_count":3781,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1084,"mirror_url":null,"open_issues_count":650,"forks":1084,"open_issues":650,"watchers":3781,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/17154"},"html":{"href":"https://github.com/akka/akka/pull/17154"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/17154"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/17154/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/17154/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/17154/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/dcb4e636850a1c01a1c233e349407e9d625f58af"}}}}