{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/marathon/pulls/comments/244926100","pull_request_review_id":188917623,"id":244926100,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDkyNjEwMA==","diff_hunk":"@@ -643,33 +631,32 @@ class TaskReplaceActorTest extends AkkaUnitTest with Eventually {\n       eventually {\n         queueOrder.verify(f.queue).add(_: AppDefinition, 1)\n       }\n-      assert(f.killService.numKilled == 0)\n \n       val newInstanceId = Instance.Id.forRunSpec(newApp.id)\n       val newTaskId = Task.Id(newInstanceId)\n \n       //unhealthy\n       ref ! InstanceHealthChanged(newInstanceId, newApp.version, newApp.id, healthy = Some(false))\n       eventually {\n-        f.killService.numKilled should be(0)\n+        verify(f.tracker, never).setGoal(any, any, any)\n       }\n \n       //unready\n       ref ! ReadinessCheckResult(ReadinessCheck.DefaultName, newTaskId, ready = false, None)\n       eventually {\n-        f.killService.numKilled should be(0)\n+        verify(f.tracker, never).setGoal(any, any, any)\n       }\n \n       //healthy\n       ref ! InstanceHealthChanged(newInstanceId, newApp.version, newApp.id, healthy = Some(true))\n       eventually {\n-        f.killService.numKilled should be(0)\n+        verify(f.tracker, never).setGoal(any, any, any)\n       }\n \n       //ready\n       ref ! ReadinessCheckResult(ReadinessCheck.DefaultName, newTaskId, ready = true, None)\n       eventually {\n-        f.killService.numKilled should be(1)\n+        verify(f.tracker, once).setGoal(any, any, any)","path":"src/test/scala/mesosphere/marathon/core/deployment/impl/TaskReplaceActorTest.scala","position":344,"original_position":344,"commit_id":"352c079725ec55da95e3519f0de7a69dc278792b","original_commit_id":"6cf2df6ff1ba8b52f3d1ea011fdc7c37768cda5a","user":{"login":"jeschkies","id":2418440,"node_id":"MDQ6VXNlcjI0MTg0NDA=","avatar_url":"https://avatars3.githubusercontent.com/u/2418440?v=4","gravatar_id":"","url":"https://api.github.com/users/jeschkies","html_url":"https://github.com/jeschkies","followers_url":"https://api.github.com/users/jeschkies/followers","following_url":"https://api.github.com/users/jeschkies/following{/other_user}","gists_url":"https://api.github.com/users/jeschkies/gists{/gist_id}","starred_url":"https://api.github.com/users/jeschkies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeschkies/subscriptions","organizations_url":"https://api.github.com/users/jeschkies/orgs","repos_url":"https://api.github.com/users/jeschkies/repos","events_url":"https://api.github.com/users/jeschkies/events{/privacy}","received_events_url":"https://api.github.com/users/jeschkies/received_events","type":"User","site_admin":false},"body":"Let's do the full implementation then. The `InstanceTrackActor` has the following props\r\n```scala\r\n  def props(\r\n    metrics: ActorMetrics,\r\n    taskLoader: InstancesLoader,\r\n    updateStepProcessor: InstanceTrackerUpdateStepProcessor,\r\n    stateOpResolver: InstanceUpdateOpResolver,\r\n    repository: InstanceView,\r\n    clock: Clock\r\n```\r\n\r\n`InstanceUpdateOpResolver` should be the actual implementation. The loader and view can be an in-memory implementation or mocks. Only the `InstanceTrackerUpdateStepProcessor` might be a little tricky. Well, when I think about it it could just use the event step and nothing else.","created_at":"2019-01-03T07:42:23Z","updated_at":"2019-01-03T07:42:23Z","html_url":"https://github.com/mesosphere/marathon/pull/6745#discussion_r244926100","pull_request_url":"https://api.github.com/repos/mesosphere/marathon/pulls/6745","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/comments/244926100"},"html":{"href":"https://github.com/mesosphere/marathon/pull/6745#discussion_r244926100"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6745"}},"in_reply_to_id":244715067},"pull_request":{"url":"https://api.github.com/repos/mesosphere/marathon/pulls/6745","id":239938243,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5OTM4MjQz","html_url":"https://github.com/mesosphere/marathon/pull/6745","diff_url":"https://github.com/mesosphere/marathon/pull/6745.diff","patch_url":"https://github.com/mesosphere/marathon/pull/6745.patch","issue_url":"https://api.github.com/repos/mesosphere/marathon/issues/6745","number":6745,"state":"open","locked":false,"title":"Kill based on goal","user":{"login":"alenkacz","id":264608,"node_id":"MDQ6VXNlcjI2NDYwOA==","avatar_url":"https://avatars1.githubusercontent.com/u/264608?v=4","gravatar_id":"","url":"https://api.github.com/users/alenkacz","html_url":"https://github.com/alenkacz","followers_url":"https://api.github.com/users/alenkacz/followers","following_url":"https://api.github.com/users/alenkacz/following{/other_user}","gists_url":"https://api.github.com/users/alenkacz/gists{/gist_id}","starred_url":"https://api.github.com/users/alenkacz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alenkacz/subscriptions","organizations_url":"https://api.github.com/users/alenkacz/orgs","repos_url":"https://api.github.com/users/alenkacz/repos","events_url":"https://api.github.com/users/alenkacz/events{/privacy}","received_events_url":"https://api.github.com/users/alenkacz/received_events","type":"User","site_admin":false},"body":"Summary:\r\nInstead of orchestrator calling `KillService` as well as `InstanceTracker.setGoal` we simplify that by calling `setGoal` only and doing the killing as a result of goal being changed.\r\n\r\nRight now every goal change emits `InstanceChanged` event (that's behavior already on master). `TaskKillerActor` hooks on this event and initiates the kill.\r\n\r\nRight now there are 1 known things missing:\r\n- this race fix has to be ported on top of this branch https://github.com/mesosphere/marathon/pull/6680 (and I am no longer convinced we need that one since `TaskKiller` is called only from API)\r\n\r\nWatching on instances being terminal is not ideal but this is how we done so far. I think we can iterate on that once we merge this.\r\n\r\nJIRA issues: MARATHON-8296\r\n","created_at":"2018-12-19T18:47:29Z","updated_at":"2019-01-03T07:42:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e1c2fe2b52b1514379402da13e3ca0f7e0efbc6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/marathon/pulls/6745/commits","review_comments_url":"https://api.github.com/repos/mesosphere/marathon/pulls/6745/comments","review_comment_url":"https://api.github.com/repos/mesosphere/marathon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/marathon/issues/6745/comments","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/352c079725ec55da95e3519f0de7a69dc278792b","head":{"label":"mesosphere:av/kill-based-on-goal","ref":"av/kill-based-on-goal","sha":"352c079725ec55da95e3519f0de7a69dc278792b","user":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":10941409,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk0MTQwOQ==","name":"marathon","full_name":"mesosphere/marathon","private":false,"owner":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mesosphere/marathon","description":"Deploy and manage containers (including Docker) on top of Apache Mesos at scale.","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon","forks_url":"https://api.github.com/repos/mesosphere/marathon/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/marathon/deployments","created_at":"2013-06-25T14:56:34Z","updated_at":"2019-01-02T21:39:46Z","pushed_at":"2019-01-03T04:21:35Z","git_url":"git://github.com/mesosphere/marathon.git","ssh_url":"git@github.com:mesosphere/marathon.git","clone_url":"https://github.com/mesosphere/marathon.git","svn_url":"https://github.com/mesosphere/marathon","homepage":"https://mesosphere.github.io/marathon/","size":40429,"stargazers_count":3778,"watchers_count":3778,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":876,"mirror_url":null,"archived":false,"open_issues_count":22,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":876,"open_issues":22,"watchers":3778,"default_branch":"master"}},"base":{"label":"mesosphere:master","ref":"master","sha":"fc5b115d17610851608a045a715054c07b61ebd5","user":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":10941409,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk0MTQwOQ==","name":"marathon","full_name":"mesosphere/marathon","private":false,"owner":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mesosphere/marathon","description":"Deploy and manage containers (including Docker) on top of Apache Mesos at scale.","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon","forks_url":"https://api.github.com/repos/mesosphere/marathon/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/marathon/deployments","created_at":"2013-06-25T14:56:34Z","updated_at":"2019-01-02T21:39:46Z","pushed_at":"2019-01-03T04:21:35Z","git_url":"git://github.com/mesosphere/marathon.git","ssh_url":"git@github.com:mesosphere/marathon.git","clone_url":"https://github.com/mesosphere/marathon.git","svn_url":"https://github.com/mesosphere/marathon","homepage":"https://mesosphere.github.io/marathon/","size":40429,"stargazers_count":3778,"watchers_count":3778,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":876,"mirror_url":null,"archived":false,"open_issues_count":22,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":876,"open_issues":22,"watchers":3778,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6745"},"html":{"href":"https://github.com/mesosphere/marathon/pull/6745"},"issue":{"href":"https://api.github.com/repos/mesosphere/marathon/issues/6745"},"comments":{"href":"https://api.github.com/repos/mesosphere/marathon/issues/6745/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6745/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6745/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/marathon/statuses/352c079725ec55da95e3519f0de7a69dc278792b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jeschkies"}}