{"action":"created","comment":{"url":"https://api.github.com/repos/Stratio/Sparkta/pulls/comments/51392733","id":51392733,"diff_hunk":"@@ -40,22 +40,32 @@ class PolicyStatusActor(curatorFramework: CuratorFramework)\n     case Create(policyStatus) => sender ! create(policyStatus)\n     case Update(policyStatus) => sender ! update(policyStatus)\n     case FindAll => findAll\n-    case Kill(name) => kill(name)\n+    case Kill(name) => sender ! kill(name)\n     case AddListener(name, callback) => addListener(name, callback)\n   }\n \n \n \n-  def kill(policyName: String): Unit = {\n-    val SparkStreamingContextActorPrefix: String = \"sparkStreamingContextActor\"\n-    implicit  val timeout:Timeout=Timeout(2L,TimeUnit.SECONDS)\n-    val pActor: Option[Try[ActorRef]] = context.\n-      actorSelection(s\"$SparkStreamingContextActorPrefix-${policyName.replace(\" \", \"_\")}\")\n-      .resolveOne().value\n+  def kill(policyName: String): Boolean = {\n+    implicit val timeout:Timeout = Timeout(2L, TimeUnit.SECONDS)\n+    val Stopped = true\n+    val NotStopped = false\n+    val pActor = context.actorSelection(s\"${AkkaConstant.SparkStreamingContextActor}-${policyName.replace(\" \", \"_\")}\")\n+        .resolveOne().value\n+\n     pActor match {\n-      case Some(Success(actor)) => context.stop(actor)\n-      case Some(Failure(e)) => log.warn(s\"there isn't $policyName actor to kill\")\n-      case None => log.warn(s\"there isn't $policyName actor to kill\")\n+      case Some(Success(actor)) => {\n+        context.stop(actor)\n+        Stopped\n+      }\n+      case Some(Failure(e)) => {\n+        log.warn(s\"There isn't $policyName actor to kill\")","path":"serving-core/src/main/scala/com/stratio/sparkta/serving/core/policy/status/PolicyStatusActor.scala","position":42,"original_position":42,"commit_id":"7101f60e8e4853c5b6e0675b164275670d081c3a","original_commit_id":"7101f60e8e4853c5b6e0675b164275670d081c3a","user":{"login":"antonioalf","id":12594504,"avatar_url":"https://avatars.githubusercontent.com/u/12594504?v=3","gravatar_id":"","url":"https://api.github.com/users/antonioalf","html_url":"https://github.com/antonioalf","followers_url":"https://api.github.com/users/antonioalf/followers","following_url":"https://api.github.com/users/antonioalf/following{/other_user}","gists_url":"https://api.github.com/users/antonioalf/gists{/gist_id}","starred_url":"https://api.github.com/users/antonioalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonioalf/subscriptions","organizations_url":"https://api.github.com/users/antonioalf/orgs","repos_url":"https://api.github.com/users/antonioalf/repos","events_url":"https://api.github.com/users/antonioalf/events{/privacy}","received_events_url":"https://api.github.com/users/antonioalf/received_events","type":"User","site_admin":false},"body":"There isn't $policyName actor to kill -> There is no policy with name: $policyName actor to kill","created_at":"2016-02-01T09:02:02Z","updated_at":"2016-02-01T09:02:02Z","html_url":"https://github.com/Stratio/Sparkta/pull/1354#discussion_r51392733","pull_request_url":"https://api.github.com/repos/Stratio/Sparkta/pulls/1354","_links":{"self":{"href":"https://api.github.com/repos/Stratio/Sparkta/pulls/comments/51392733"},"html":{"href":"https://github.com/Stratio/Sparkta/pull/1354#discussion_r51392733"},"pull_request":{"href":"https://api.github.com/repos/Stratio/Sparkta/pulls/1354"}}},"pull_request":{"url":"https://api.github.com/repos/Stratio/Sparkta/pulls/1354","id":55463230,"html_url":"https://github.com/Stratio/Sparkta/pull/1354","diff_url":"https://github.com/Stratio/Sparkta/pull/1354.diff","patch_url":"https://github.com/Stratio/Sparkta/pull/1354.patch","issue_url":"https://api.github.com/repos/Stratio/Sparkta/issues/1354","number":1354,"state":"open","locked":false,"title":"[SPARKTA-197] [DRIVER] Stop policies correctly","user":{"login":"compae","id":8297897,"avatar_url":"https://avatars.githubusercontent.com/u/8297897?v=3","gravatar_id":"","url":"https://api.github.com/users/compae","html_url":"https://github.com/compae","followers_url":"https://api.github.com/users/compae/followers","following_url":"https://api.github.com/users/compae/following{/other_user}","gists_url":"https://api.github.com/users/compae/gists{/gist_id}","starred_url":"https://api.github.com/users/compae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compae/subscriptions","organizations_url":"https://api.github.com/users/compae/orgs","repos_url":"https://api.github.com/users/compae/repos","events_url":"https://api.github.com/users/compae/events{/privacy}","received_events_url":"https://api.github.com/users/compae/received_events","type":"User","site_admin":false},"body":"#### Description\r\n\r\nExceptions and error control when stopping spark context and actors.\r\n\r\n#### Reviewer\r\n@Gschiavon \r\n\r\n#### Test\r\nAll passed.","created_at":"2016-01-08T13:51:03Z","updated_at":"2016-02-01T09:02:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2d43c3c52ff5ab0f1c9ca773e43e943b5c39883","assignee":{"login":"antonioalf","id":12594504,"avatar_url":"https://avatars.githubusercontent.com/u/12594504?v=3","gravatar_id":"","url":"https://api.github.com/users/antonioalf","html_url":"https://github.com/antonioalf","followers_url":"https://api.github.com/users/antonioalf/followers","following_url":"https://api.github.com/users/antonioalf/following{/other_user}","gists_url":"https://api.github.com/users/antonioalf/gists{/gist_id}","starred_url":"https://api.github.com/users/antonioalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonioalf/subscriptions","organizations_url":"https://api.github.com/users/antonioalf/orgs","repos_url":"https://api.github.com/users/antonioalf/repos","events_url":"https://api.github.com/users/antonioalf/events{/privacy}","received_events_url":"https://api.github.com/users/antonioalf/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Stratio/Sparkta/pulls/1354/commits","review_comments_url":"https://api.github.com/repos/Stratio/Sparkta/pulls/1354/comments","review_comment_url":"https://api.github.com/repos/Stratio/Sparkta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Stratio/Sparkta/issues/1354/comments","statuses_url":"https://api.github.com/repos/Stratio/Sparkta/statuses/7101f60e8e4853c5b6e0675b164275670d081c3a","head":{"label":"compae:bug/stopping-policy-correctly-cluster","ref":"bug/stopping-policy-correctly-cluster","sha":"7101f60e8e4853c5b6e0675b164275670d081c3a","user":{"login":"compae","id":8297897,"avatar_url":"https://avatars.githubusercontent.com/u/8297897?v=3","gravatar_id":"","url":"https://api.github.com/users/compae","html_url":"https://github.com/compae","followers_url":"https://api.github.com/users/compae/followers","following_url":"https://api.github.com/users/compae/following{/other_user}","gists_url":"https://api.github.com/users/compae/gists{/gist_id}","starred_url":"https://api.github.com/users/compae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compae/subscriptions","organizations_url":"https://api.github.com/users/compae/orgs","repos_url":"https://api.github.com/users/compae/repos","events_url":"https://api.github.com/users/compae/events{/privacy}","received_events_url":"https://api.github.com/users/compae/received_events","type":"User","site_admin":false},"repo":{"id":35189883,"name":"sparkta","full_name":"compae/sparkta","owner":{"login":"compae","id":8297897,"avatar_url":"https://avatars.githubusercontent.com/u/8297897?v=3","gravatar_id":"","url":"https://api.github.com/users/compae","html_url":"https://github.com/compae","followers_url":"https://api.github.com/users/compae/followers","following_url":"https://api.github.com/users/compae/following{/other_user}","gists_url":"https://api.github.com/users/compae/gists{/gist_id}","starred_url":"https://api.github.com/users/compae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compae/subscriptions","organizations_url":"https://api.github.com/users/compae/orgs","repos_url":"https://api.github.com/users/compae/repos","events_url":"https://api.github.com/users/compae/events{/privacy}","received_events_url":"https://api.github.com/users/compae/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/compae/sparkta","description":"Real Time Aggregation based on Spark Streaming","fork":true,"url":"https://api.github.com/repos/compae/sparkta","forks_url":"https://api.github.com/repos/compae/sparkta/forks","keys_url":"https://api.github.com/repos/compae/sparkta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/compae/sparkta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/compae/sparkta/teams","hooks_url":"https://api.github.com/repos/compae/sparkta/hooks","issue_events_url":"https://api.github.com/repos/compae/sparkta/issues/events{/number}","events_url":"https://api.github.com/repos/compae/sparkta/events","assignees_url":"https://api.github.com/repos/compae/sparkta/assignees{/user}","branches_url":"https://api.github.com/repos/compae/sparkta/branches{/branch}","tags_url":"https://api.github.com/repos/compae/sparkta/tags","blobs_url":"https://api.github.com/repos/compae/sparkta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/compae/sparkta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/compae/sparkta/git/refs{/sha}","trees_url":"https://api.github.com/repos/compae/sparkta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/compae/sparkta/statuses/{sha}","languages_url":"https://api.github.com/repos/compae/sparkta/languages","stargazers_url":"https://api.github.com/repos/compae/sparkta/stargazers","contributors_url":"https://api.github.com/repos/compae/sparkta/contributors","subscribers_url":"https://api.github.com/repos/compae/sparkta/subscribers","subscription_url":"https://api.github.com/repos/compae/sparkta/subscription","commits_url":"https://api.github.com/repos/compae/sparkta/commits{/sha}","git_commits_url":"https://api.github.com/repos/compae/sparkta/git/commits{/sha}","comments_url":"https://api.github.com/repos/compae/sparkta/comments{/number}","issue_comment_url":"https://api.github.com/repos/compae/sparkta/issues/comments{/number}","contents_url":"https://api.github.com/repos/compae/sparkta/contents/{+path}","compare_url":"https://api.github.com/repos/compae/sparkta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/compae/sparkta/merges","archive_url":"https://api.github.com/repos/compae/sparkta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/compae/sparkta/downloads","issues_url":"https://api.github.com/repos/compae/sparkta/issues{/number}","pulls_url":"https://api.github.com/repos/compae/sparkta/pulls{/number}","milestones_url":"https://api.github.com/repos/compae/sparkta/milestones{/number}","notifications_url":"https://api.github.com/repos/compae/sparkta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/compae/sparkta/labels{/name}","releases_url":"https://api.github.com/repos/compae/sparkta/releases{/id}","deployments_url":"https://api.github.com/repos/compae/sparkta/deployments","created_at":"2015-05-07T00:25:20Z","updated_at":"2016-01-11T11:24:43Z","pushed_at":"2016-01-29T13:00:00Z","git_url":"git://github.com/compae/sparkta.git","ssh_url":"git@github.com:compae/sparkta.git","clone_url":"https://github.com/compae/sparkta.git","svn_url":"https://github.com/compae/sparkta","homepage":"http://www.stratio.com","size":55934,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Stratio:master","ref":"master","sha":"fc37f2f405874f79a585d3219c8c6999b6bf5be3","user":{"login":"Stratio","id":5228027,"avatar_url":"https://avatars.githubusercontent.com/u/5228027?v=3","gravatar_id":"","url":"https://api.github.com/users/Stratio","html_url":"https://github.com/Stratio","followers_url":"https://api.github.com/users/Stratio/followers","following_url":"https://api.github.com/users/Stratio/following{/other_user}","gists_url":"https://api.github.com/users/Stratio/gists{/gist_id}","starred_url":"https://api.github.com/users/Stratio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stratio/subscriptions","organizations_url":"https://api.github.com/users/Stratio/orgs","repos_url":"https://api.github.com/users/Stratio/repos","events_url":"https://api.github.com/users/Stratio/events{/privacy}","received_events_url":"https://api.github.com/users/Stratio/received_events","type":"Organization","site_admin":false},"repo":{"id":30288112,"name":"Sparkta","full_name":"Stratio/Sparkta","owner":{"login":"Stratio","id":5228027,"avatar_url":"https://avatars.githubusercontent.com/u/5228027?v=3","gravatar_id":"","url":"https://api.github.com/users/Stratio","html_url":"https://github.com/Stratio","followers_url":"https://api.github.com/users/Stratio/followers","following_url":"https://api.github.com/users/Stratio/following{/other_user}","gists_url":"https://api.github.com/users/Stratio/gists{/gist_id}","starred_url":"https://api.github.com/users/Stratio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stratio/subscriptions","organizations_url":"https://api.github.com/users/Stratio/orgs","repos_url":"https://api.github.com/users/Stratio/repos","events_url":"https://api.github.com/users/Stratio/events{/privacy}","received_events_url":"https://api.github.com/users/Stratio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Stratio/Sparkta","description":"Real Time Aggregation based on Spark Streaming","fork":false,"url":"https://api.github.com/repos/Stratio/Sparkta","forks_url":"https://api.github.com/repos/Stratio/Sparkta/forks","keys_url":"https://api.github.com/repos/Stratio/Sparkta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Stratio/Sparkta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Stratio/Sparkta/teams","hooks_url":"https://api.github.com/repos/Stratio/Sparkta/hooks","issue_events_url":"https://api.github.com/repos/Stratio/Sparkta/issues/events{/number}","events_url":"https://api.github.com/repos/Stratio/Sparkta/events","assignees_url":"https://api.github.com/repos/Stratio/Sparkta/assignees{/user}","branches_url":"https://api.github.com/repos/Stratio/Sparkta/branches{/branch}","tags_url":"https://api.github.com/repos/Stratio/Sparkta/tags","blobs_url":"https://api.github.com/repos/Stratio/Sparkta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Stratio/Sparkta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Stratio/Sparkta/git/refs{/sha}","trees_url":"https://api.github.com/repos/Stratio/Sparkta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Stratio/Sparkta/statuses/{sha}","languages_url":"https://api.github.com/repos/Stratio/Sparkta/languages","stargazers_url":"https://api.github.com/repos/Stratio/Sparkta/stargazers","contributors_url":"https://api.github.com/repos/Stratio/Sparkta/contributors","subscribers_url":"https://api.github.com/repos/Stratio/Sparkta/subscribers","subscription_url":"https://api.github.com/repos/Stratio/Sparkta/subscription","commits_url":"https://api.github.com/repos/Stratio/Sparkta/commits{/sha}","git_commits_url":"https://api.github.com/repos/Stratio/Sparkta/git/commits{/sha}","comments_url":"https://api.github.com/repos/Stratio/Sparkta/comments{/number}","issue_comment_url":"https://api.github.com/repos/Stratio/Sparkta/issues/comments{/number}","contents_url":"https://api.github.com/repos/Stratio/Sparkta/contents/{+path}","compare_url":"https://api.github.com/repos/Stratio/Sparkta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Stratio/Sparkta/merges","archive_url":"https://api.github.com/repos/Stratio/Sparkta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Stratio/Sparkta/downloads","issues_url":"https://api.github.com/repos/Stratio/Sparkta/issues{/number}","pulls_url":"https://api.github.com/repos/Stratio/Sparkta/pulls{/number}","milestones_url":"https://api.github.com/repos/Stratio/Sparkta/milestones{/number}","notifications_url":"https://api.github.com/repos/Stratio/Sparkta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Stratio/Sparkta/labels{/name}","releases_url":"https://api.github.com/repos/Stratio/Sparkta/releases{/id}","deployments_url":"https://api.github.com/repos/Stratio/Sparkta/deployments","created_at":"2015-02-04T08:04:40Z","updated_at":"2016-01-31T19:38:02Z","pushed_at":"2016-01-29T13:04:11Z","git_url":"git://github.com/Stratio/Sparkta.git","ssh_url":"git@github.com:Stratio/Sparkta.git","clone_url":"https://github.com/Stratio/Sparkta.git","svn_url":"https://github.com/Stratio/Sparkta","homepage":"http://www.stratio.com","size":32341,"stargazers_count":174,"watchers_count":174,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":306,"forks":40,"open_issues":306,"watchers":174,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Stratio/Sparkta/pulls/1354"},"html":{"href":"https://github.com/Stratio/Sparkta/pull/1354"},"issue":{"href":"https://api.github.com/repos/Stratio/Sparkta/issues/1354"},"comments":{"href":"https://api.github.com/repos/Stratio/Sparkta/issues/1354/comments"},"review_comments":{"href":"https://api.github.com/repos/Stratio/Sparkta/pulls/1354/comments"},"review_comment":{"href":"https://api.github.com/repos/Stratio/Sparkta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Stratio/Sparkta/pulls/1354/commits"},"statuses":{"href":"https://api.github.com/repos/Stratio/Sparkta/statuses/7101f60e8e4853c5b6e0675b164275670d081c3a"}}}}