{"action":"created","comment":{"url":"https://api.github.com/repos/ray-project/ray/pulls/comments/244900198","pull_request_review_id":188885315,"id":244900198,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDkwMDE5OA==","diff_hunk":"@@ -40,13 +40,39 @@ const std::unordered_map<ActorHandleID, ActorRegistration::FrontierLeaf>\n   return frontier_;\n }\n \n-void ActorRegistration::ExtendFrontier(const ActorHandleID &handle_id,\n-                                       const ObjectID &execution_dependency) {\n+ObjectID ActorRegistration::ExtendFrontier(const ActorHandleID &handle_id,\n+                                           const ObjectID &execution_dependency) {\n   auto &frontier_entry = frontier_[handle_id];\n+  // Release the reference to the previous cursor for this\n+  // actor handle, if there was one.\n+  ObjectID object_to_release;\n+  if (!frontier_entry.execution_dependency.is_nil()) {\n+    auto it = dummy_objects_.find(frontier_entry.execution_dependency);\n+    RAY_CHECK(it != dummy_objects_.end());\n+    it->second--;\n+    RAY_CHECK(it->second >= 0);\n+    if (it->second == 0) {\n+      object_to_release = frontier_entry.execution_dependency;\n+      dummy_objects_.erase(it);\n+    }\n+  }\n+\n   frontier_entry.task_counter++;\n   frontier_entry.execution_dependency = execution_dependency;\n   execution_dependency_ = execution_dependency;\n-  dummy_objects_.push_back(execution_dependency);\n+  // Add the reference to the new cursor for this actor handle.\n+  dummy_objects_[execution_dependency]++;\n+  return object_to_release;\n+}\n+\n+void ActorRegistration::AddHandle(const ActorHandleID &handle_id,\n+                                  const ObjectID &execution_dependency) {\n+  if (frontier_.find(handle_id) == frontier_.end()) {\n+    frontier_[handle_id] = FrontierLeaf{\n+        .task_counter = 0, .execution_dependency = execution_dependency,","path":"src/ray/raylet/actor_registration.cc","position":36,"original_position":36,"commit_id":"374a65169125091ac323e9be62bcd298d6109f5a","original_commit_id":"374a65169125091ac323e9be62bcd298d6109f5a","user":{"login":"stephanie-wang","id":2560516,"node_id":"MDQ6VXNlcjI1NjA1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/2560516?v=4","gravatar_id":"","url":"https://api.github.com/users/stephanie-wang","html_url":"https://github.com/stephanie-wang","followers_url":"https://api.github.com/users/stephanie-wang/followers","following_url":"https://api.github.com/users/stephanie-wang/following{/other_user}","gists_url":"https://api.github.com/users/stephanie-wang/gists{/gist_id}","starred_url":"https://api.github.com/users/stephanie-wang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephanie-wang/subscriptions","organizations_url":"https://api.github.com/users/stephanie-wang/orgs","repos_url":"https://api.github.com/users/stephanie-wang/repos","events_url":"https://api.github.com/users/stephanie-wang/events{/privacy}","received_events_url":"https://api.github.com/users/stephanie-wang/received_events","type":"User","site_admin":false},"body":"Hmm, I wasn't aware of any pros/cons. Do you have any suggestions in mind?","created_at":"2019-01-03T01:47:01Z","updated_at":"2019-01-03T01:47:01Z","html_url":"https://github.com/ray-project/ray/pull/3593#discussion_r244900198","pull_request_url":"https://api.github.com/repos/ray-project/ray/pulls/3593","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ray-project/ray/pulls/comments/244900198"},"html":{"href":"https://github.com/ray-project/ray/pull/3593#discussion_r244900198"},"pull_request":{"href":"https://api.github.com/repos/ray-project/ray/pulls/3593"}},"in_reply_to_id":244426117},"pull_request":{"url":"https://api.github.com/repos/ray-project/ray/pulls/3593","id":240343844,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQwMzQzODQ0","html_url":"https://github.com/ray-project/ray/pull/3593","diff_url":"https://github.com/ray-project/ray/pull/3593.diff","patch_url":"https://github.com/ray-project/ray/pull/3593.patch","issue_url":"https://api.github.com/repos/ray-project/ray/issues/3593","number":3593,"state":"open","locked":false,"title":"Actor dummy object garbage collection","user":{"login":"stephanie-wang","id":2560516,"node_id":"MDQ6VXNlcjI1NjA1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/2560516?v=4","gravatar_id":"","url":"https://api.github.com/users/stephanie-wang","html_url":"https://github.com/stephanie-wang","followers_url":"https://api.github.com/users/stephanie-wang/followers","following_url":"https://api.github.com/users/stephanie-wang/following{/other_user}","gists_url":"https://api.github.com/users/stephanie-wang/gists{/gist_id}","starred_url":"https://api.github.com/users/stephanie-wang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephanie-wang/subscriptions","organizations_url":"https://api.github.com/users/stephanie-wang/orgs","repos_url":"https://api.github.com/users/stephanie-wang/repos","events_url":"https://api.github.com/users/stephanie-wang/events{/privacy}","received_events_url":"https://api.github.com/users/stephanie-wang/received_events","type":"User","site_admin":false},"body":"## What do these changes do?\r\n\r\nThis minimizes the number of pinned dummy objects per actor by only pinning the ones necessary to execute new actor tasks. This implements the solution described in #3308. Note that this does not solve the issue of garbage-collecting actor handles that are no longer needed, or the issue of general actor garbage collection.\r\n\r\n## Related issue number\r\n\r\nCloses #3308.\r\n","created_at":"2018-12-21T00:53:39Z","updated_at":"2019-01-03T01:47:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3804b437729a50e5086229c56aaf47abe6b2f2ec","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ericl","id":14922,"node_id":"MDQ6VXNlcjE0OTIy","avatar_url":"https://avatars3.githubusercontent.com/u/14922?v=4","gravatar_id":"","url":"https://api.github.com/users/ericl","html_url":"https://github.com/ericl","followers_url":"https://api.github.com/users/ericl/followers","following_url":"https://api.github.com/users/ericl/following{/other_user}","gists_url":"https://api.github.com/users/ericl/gists{/gist_id}","starred_url":"https://api.github.com/users/ericl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericl/subscriptions","organizations_url":"https://api.github.com/users/ericl/orgs","repos_url":"https://api.github.com/users/ericl/repos","events_url":"https://api.github.com/users/ericl/events{/privacy}","received_events_url":"https://api.github.com/users/ericl/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1119780425,"node_id":"MDU6TGFiZWwxMTE5NzgwNDI1","url":"https://api.github.com/repos/ray-project/ray/labels/stability-blocker","name":"stability-blocker","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ray-project/ray/pulls/3593/commits","review_comments_url":"https://api.github.com/repos/ray-project/ray/pulls/3593/comments","review_comment_url":"https://api.github.com/repos/ray-project/ray/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ray-project/ray/issues/3593/comments","statuses_url":"https://api.github.com/repos/ray-project/ray/statuses/374a65169125091ac323e9be62bcd298d6109f5a","head":{"label":"stephanie-wang:actor-dummy-object-gc","ref":"actor-dummy-object-gc","sha":"374a65169125091ac323e9be62bcd298d6109f5a","user":{"login":"stephanie-wang","id":2560516,"node_id":"MDQ6VXNlcjI1NjA1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/2560516?v=4","gravatar_id":"","url":"https://api.github.com/users/stephanie-wang","html_url":"https://github.com/stephanie-wang","followers_url":"https://api.github.com/users/stephanie-wang/followers","following_url":"https://api.github.com/users/stephanie-wang/following{/other_user}","gists_url":"https://api.github.com/users/stephanie-wang/gists{/gist_id}","starred_url":"https://api.github.com/users/stephanie-wang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephanie-wang/subscriptions","organizations_url":"https://api.github.com/users/stephanie-wang/orgs","repos_url":"https://api.github.com/users/stephanie-wang/repos","events_url":"https://api.github.com/users/stephanie-wang/events{/privacy}","received_events_url":"https://api.github.com/users/stephanie-wang/received_events","type":"User","site_admin":false},"repo":{"id":77302388,"node_id":"MDEwOlJlcG9zaXRvcnk3NzMwMjM4OA==","name":"ray","full_name":"stephanie-wang/ray","private":false,"owner":{"login":"stephanie-wang","id":2560516,"node_id":"MDQ6VXNlcjI1NjA1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/2560516?v=4","gravatar_id":"","url":"https://api.github.com/users/stephanie-wang","html_url":"https://github.com/stephanie-wang","followers_url":"https://api.github.com/users/stephanie-wang/followers","following_url":"https://api.github.com/users/stephanie-wang/following{/other_user}","gists_url":"https://api.github.com/users/stephanie-wang/gists{/gist_id}","starred_url":"https://api.github.com/users/stephanie-wang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephanie-wang/subscriptions","organizations_url":"https://api.github.com/users/stephanie-wang/orgs","repos_url":"https://api.github.com/users/stephanie-wang/repos","events_url":"https://api.github.com/users/stephanie-wang/events{/privacy}","received_events_url":"https://api.github.com/users/stephanie-wang/received_events","type":"User","site_admin":false},"html_url":"https://github.com/stephanie-wang/ray","description":"An experimental distributed execution engine","fork":true,"url":"https://api.github.com/repos/stephanie-wang/ray","forks_url":"https://api.github.com/repos/stephanie-wang/ray/forks","keys_url":"https://api.github.com/repos/stephanie-wang/ray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stephanie-wang/ray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stephanie-wang/ray/teams","hooks_url":"https://api.github.com/repos/stephanie-wang/ray/hooks","issue_events_url":"https://api.github.com/repos/stephanie-wang/ray/issues/events{/number}","events_url":"https://api.github.com/repos/stephanie-wang/ray/events","assignees_url":"https://api.github.com/repos/stephanie-wang/ray/assignees{/user}","branches_url":"https://api.github.com/repos/stephanie-wang/ray/branches{/branch}","tags_url":"https://api.github.com/repos/stephanie-wang/ray/tags","blobs_url":"https://api.github.com/repos/stephanie-wang/ray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stephanie-wang/ray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stephanie-wang/ray/git/refs{/sha}","trees_url":"https://api.github.com/repos/stephanie-wang/ray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stephanie-wang/ray/statuses/{sha}","languages_url":"https://api.github.com/repos/stephanie-wang/ray/languages","stargazers_url":"https://api.github.com/repos/stephanie-wang/ray/stargazers","contributors_url":"https://api.github.com/repos/stephanie-wang/ray/contributors","subscribers_url":"https://api.github.com/repos/stephanie-wang/ray/subscribers","subscription_url":"https://api.github.com/repos/stephanie-wang/ray/subscription","commits_url":"https://api.github.com/repos/stephanie-wang/ray/commits{/sha}","git_commits_url":"https://api.github.com/repos/stephanie-wang/ray/git/commits{/sha}","comments_url":"https://api.github.com/repos/stephanie-wang/ray/comments{/number}","issue_comment_url":"https://api.github.com/repos/stephanie-wang/ray/issues/comments{/number}","contents_url":"https://api.github.com/repos/stephanie-wang/ray/contents/{+path}","compare_url":"https://api.github.com/repos/stephanie-wang/ray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stephanie-wang/ray/merges","archive_url":"https://api.github.com/repos/stephanie-wang/ray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stephanie-wang/ray/downloads","issues_url":"https://api.github.com/repos/stephanie-wang/ray/issues{/number}","pulls_url":"https://api.github.com/repos/stephanie-wang/ray/pulls{/number}","milestones_url":"https://api.github.com/repos/stephanie-wang/ray/milestones{/number}","notifications_url":"https://api.github.com/repos/stephanie-wang/ray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stephanie-wang/ray/labels{/name}","releases_url":"https://api.github.com/repos/stephanie-wang/ray/releases{/id}","deployments_url":"https://api.github.com/repos/stephanie-wang/ray/deployments","created_at":"2016-12-24T22:37:23Z","updated_at":"2018-08-28T21:07:29Z","pushed_at":"2018-12-28T22:09:20Z","git_url":"git://github.com/stephanie-wang/ray.git","ssh_url":"git@github.com:stephanie-wang/ray.git","clone_url":"https://github.com/stephanie-wang/ray.git","svn_url":"https://github.com/stephanie-wang/ray","homepage":"","size":24149,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ray-project:master","ref":"master","sha":"3df1e1c471aef6a54d2c5011e0839f5fb9443922","user":{"login":"ray-project","id":22125274,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMTI1Mjc0","avatar_url":"https://avatars3.githubusercontent.com/u/22125274?v=4","gravatar_id":"","url":"https://api.github.com/users/ray-project","html_url":"https://github.com/ray-project","followers_url":"https://api.github.com/users/ray-project/followers","following_url":"https://api.github.com/users/ray-project/following{/other_user}","gists_url":"https://api.github.com/users/ray-project/gists{/gist_id}","starred_url":"https://api.github.com/users/ray-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ray-project/subscriptions","organizations_url":"https://api.github.com/users/ray-project/orgs","repos_url":"https://api.github.com/users/ray-project/repos","events_url":"https://api.github.com/users/ray-project/events{/privacy}","received_events_url":"https://api.github.com/users/ray-project/received_events","type":"Organization","site_admin":false},"repo":{"id":71932349,"node_id":"MDEwOlJlcG9zaXRvcnk3MTkzMjM0OQ==","name":"ray","full_name":"ray-project/ray","private":false,"owner":{"login":"ray-project","id":22125274,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMTI1Mjc0","avatar_url":"https://avatars3.githubusercontent.com/u/22125274?v=4","gravatar_id":"","url":"https://api.github.com/users/ray-project","html_url":"https://github.com/ray-project","followers_url":"https://api.github.com/users/ray-project/followers","following_url":"https://api.github.com/users/ray-project/following{/other_user}","gists_url":"https://api.github.com/users/ray-project/gists{/gist_id}","starred_url":"https://api.github.com/users/ray-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ray-project/subscriptions","organizations_url":"https://api.github.com/users/ray-project/orgs","repos_url":"https://api.github.com/users/ray-project/repos","events_url":"https://api.github.com/users/ray-project/events{/privacy}","received_events_url":"https://api.github.com/users/ray-project/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ray-project/ray","description":"A system for parallel and distributed Python that unifies the ML ecosystem.","fork":false,"url":"https://api.github.com/repos/ray-project/ray","forks_url":"https://api.github.com/repos/ray-project/ray/forks","keys_url":"https://api.github.com/repos/ray-project/ray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ray-project/ray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ray-project/ray/teams","hooks_url":"https://api.github.com/repos/ray-project/ray/hooks","issue_events_url":"https://api.github.com/repos/ray-project/ray/issues/events{/number}","events_url":"https://api.github.com/repos/ray-project/ray/events","assignees_url":"https://api.github.com/repos/ray-project/ray/assignees{/user}","branches_url":"https://api.github.com/repos/ray-project/ray/branches{/branch}","tags_url":"https://api.github.com/repos/ray-project/ray/tags","blobs_url":"https://api.github.com/repos/ray-project/ray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ray-project/ray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ray-project/ray/git/refs{/sha}","trees_url":"https://api.github.com/repos/ray-project/ray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ray-project/ray/statuses/{sha}","languages_url":"https://api.github.com/repos/ray-project/ray/languages","stargazers_url":"https://api.github.com/repos/ray-project/ray/stargazers","contributors_url":"https://api.github.com/repos/ray-project/ray/contributors","subscribers_url":"https://api.github.com/repos/ray-project/ray/subscribers","subscription_url":"https://api.github.com/repos/ray-project/ray/subscription","commits_url":"https://api.github.com/repos/ray-project/ray/commits{/sha}","git_commits_url":"https://api.github.com/repos/ray-project/ray/git/commits{/sha}","comments_url":"https://api.github.com/repos/ray-project/ray/comments{/number}","issue_comment_url":"https://api.github.com/repos/ray-project/ray/issues/comments{/number}","contents_url":"https://api.github.com/repos/ray-project/ray/contents/{+path}","compare_url":"https://api.github.com/repos/ray-project/ray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ray-project/ray/merges","archive_url":"https://api.github.com/repos/ray-project/ray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ray-project/ray/downloads","issues_url":"https://api.github.com/repos/ray-project/ray/issues{/number}","pulls_url":"https://api.github.com/repos/ray-project/ray/pulls{/number}","milestones_url":"https://api.github.com/repos/ray-project/ray/milestones{/number}","notifications_url":"https://api.github.com/repos/ray-project/ray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ray-project/ray/labels{/name}","releases_url":"https://api.github.com/repos/ray-project/ray/releases{/id}","deployments_url":"https://api.github.com/repos/ray-project/ray/deployments","created_at":"2016-10-25T19:38:30Z","updated_at":"2019-01-03T01:13:15Z","pushed_at":"2019-01-03T01:04:00Z","git_url":"git://github.com/ray-project/ray.git","ssh_url":"git@github.com:ray-project/ray.git","clone_url":"https://github.com/ray-project/ray.git","svn_url":"https://github.com/ray-project/ray","homepage":"https://ray.readthedocs.io/en/latest/","size":17888,"stargazers_count":5195,"watchers_count":5195,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":714,"mirror_url":null,"archived":false,"open_issues_count":519,"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":714,"open_issues":519,"watchers":5195,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ray-project/ray/pulls/3593"},"html":{"href":"https://github.com/ray-project/ray/pull/3593"},"issue":{"href":"https://api.github.com/repos/ray-project/ray/issues/3593"},"comments":{"href":"https://api.github.com/repos/ray-project/ray/issues/3593/comments"},"review_comments":{"href":"https://api.github.com/repos/ray-project/ray/pulls/3593/comments"},"review_comment":{"href":"https://api.github.com/repos/ray-project/ray/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ray-project/ray/pulls/3593/commits"},"statuses":{"href":"https://api.github.com/repos/ray-project/ray/statuses/374a65169125091ac323e9be62bcd298d6109f5a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"stephanie-wang"}}