{"action":"created","comment":{"url":"https://api.github.com/repos/ray-project/ray/pulls/comments/97190031","pull_request_review_id":17799370,"id":97190031,"diff_hunk":"@@ -143,42 +213,26 @@ bool can_run(scheduling_algorithm_state *algorithm_state, task_spec *task) {\n \n /* TODO(rkn): This method will need to be changed to call reconstruct. */\n int fetch_object_timeout_handler(event_loop *loop, timer_id id, void *context) {\n-  fetch_object_request *fetch_req = (fetch_object_request *) context;\n-  object_id object_ids[1] = {fetch_req->object_id};\n-  plasma_fetch(fetch_req->state->plasma_conn, 1, object_ids);\n-  return LOCAL_SCHEDULER_FETCH_TIMEOUT_MILLISECONDS;\n-}\n+  local_scheduler_state *state = context;\n+  /* Only try the fetches if we are connected to the object store manager. */\n+  if (!plasma_manager_is_connected(state->plasma_conn)) {\n+    LOG_INFO(\"Local scheduler is not connected to a object store manager\");\n+    return LOCAL_SCHEDULER_FETCH_TIMEOUT_MILLISECONDS;\n+  }\n \n-void fetch_missing_dependencies(local_scheduler_state *state,\n-                                scheduling_algorithm_state *algorithm_state,\n-                                task_spec *spec) {\n-  int64_t num_args = task_num_args(spec);\n-  for (int i = 0; i < num_args; ++i) {\n-    if (task_arg_type(spec, i) == ARG_BY_REF) {\n-      object_id obj_id = task_arg_id(spec, i);\n-      available_object *entry;\n-      HASH_FIND(handle, algorithm_state->local_objects, &obj_id, sizeof(obj_id),\n-                entry);\n-      if (entry == NULL) {\n-        /* The object is not present locally, fetch the object. */\n-        object_id object_ids[1] = {obj_id};\n-        plasma_fetch(state->plasma_conn, 1, object_ids);\n-        /* Create a fetch request and add a timer to the event loop to ensure\n-         * that the fetch actually happens. */\n-        fetch_object_request *fetch_req = malloc(sizeof(fetch_object_request));\n-        fetch_req->object_id = obj_id;\n-        fetch_req->state = state;\n-        fetch_req->algorithm_state = algorithm_state;\n-        fetch_req->timer = event_loop_add_timer(\n-            state->loop, LOCAL_SCHEDULER_FETCH_TIMEOUT_MILLISECONDS,\n-            fetch_object_timeout_handler, fetch_req);\n-        /* The fetch request will be freed and removed from the hash table in\n-         * handle_object_available when the object becomes available locally. */\n-        HASH_ADD(hh, algorithm_state->fetch_requests, object_id,\n-                 sizeof(fetch_req->object_id), fetch_req);\n-      }\n-    }\n+  /* Allocate a buffer to hold all the object IDs for active fetch requests. */\n+  int num_object_ids = HASH_COUNT(state->algorithm_state->remote_objects);\n+  object_id *object_ids = malloc(num_object_ids * sizeof(object_id));","path":"src/photon/photon_algorithm.c","position":243,"original_position":243,"commit_id":"9ab5d94524fb6ad7b1d6cc16abd79c20acbf927d","original_commit_id":"9ab5d94524fb6ad7b1d6cc16abd79c20acbf927d","user":{"login":"pcmoritz","id":113316,"avatar_url":"https://avatars.githubusercontent.com/u/113316?v=3","gravatar_id":"","url":"https://api.github.com/users/pcmoritz","html_url":"https://github.com/pcmoritz","followers_url":"https://api.github.com/users/pcmoritz/followers","following_url":"https://api.github.com/users/pcmoritz/following{/other_user}","gists_url":"https://api.github.com/users/pcmoritz/gists{/gist_id}","starred_url":"https://api.github.com/users/pcmoritz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcmoritz/subscriptions","organizations_url":"https://api.github.com/users/pcmoritz/orgs","repos_url":"https://api.github.com/users/pcmoritz/repos","events_url":"https://api.github.com/users/pcmoritz/events{/privacy}","received_events_url":"https://api.github.com/users/pcmoritz/received_events","type":"User","site_admin":false},"body":"This is not freed at the moment","created_at":"2017-01-21T03:53:57Z","updated_at":"2017-01-21T03:53:57Z","html_url":"https://github.com/ray-project/ray/pull/219#discussion_r97190031","pull_request_url":"https://api.github.com/repos/ray-project/ray/pulls/219","_links":{"self":{"href":"https://api.github.com/repos/ray-project/ray/pulls/comments/97190031"},"html":{"href":"https://github.com/ray-project/ray/pull/219#discussion_r97190031"},"pull_request":{"href":"https://api.github.com/repos/ray-project/ray/pulls/219"}}},"pull_request":{"url":"https://api.github.com/repos/ray-project/ray/pulls/219","id":102226122,"html_url":"https://github.com/ray-project/ray/pull/219","diff_url":"https://github.com/ray-project/ray/pull/219.diff","patch_url":"https://github.com/ray-project/ray/pull/219.patch","issue_url":"https://api.github.com/repos/ray-project/ray/issues/219","number":219,"state":"open","locked":false,"title":"Photon optimizations","user":{"login":"stephanie-wang","id":2560516,"avatar_url":"https://avatars.githubusercontent.com/u/2560516?v=3","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":"This introduces two optimizations in Photon:\r\n1) Track mapping of missing object to dependent tasks to avoid iterating over task queue\r\n2) Perform all fetch requests for missing objects using the same timer\r\n\r\nFor a microbenchmark that submits many tasks with chain dependencies, the bottleneck now appears to be marshalling/sending the fetch requests for missing object dependencies.","created_at":"2017-01-19T09:06:59Z","updated_at":"2017-01-21T03:53:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee32f04221be00b49cd5eee015183d2ace57a40b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ray-project/ray/pulls/219/commits","review_comments_url":"https://api.github.com/repos/ray-project/ray/pulls/219/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/219/comments","statuses_url":"https://api.github.com/repos/ray-project/ray/statuses/9ab5d94524fb6ad7b1d6cc16abd79c20acbf927d","head":{"label":"stephanie-wang:photon-submit-optimization","ref":"photon-submit-optimization","sha":"9ab5d94524fb6ad7b1d6cc16abd79c20acbf927d","user":{"login":"stephanie-wang","id":2560516,"avatar_url":"https://avatars.githubusercontent.com/u/2560516?v=3","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,"name":"ray","full_name":"stephanie-wang/ray","owner":{"login":"stephanie-wang","id":2560516,"avatar_url":"https://avatars.githubusercontent.com/u/2560516?v=3","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},"private":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":"2016-12-24T22:37:27Z","pushed_at":"2017-01-20T02:16:02Z","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":2879,"stargazers_count":0,"watchers_count":0,"language":"C","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":"ray-project:master","ref":"master","sha":"4f6100b67f095f9541335dda38a44d8005c0a6c7","user":{"login":"ray-project","id":22125274,"avatar_url":"https://avatars.githubusercontent.com/u/22125274?v=3","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,"name":"ray","full_name":"ray-project/ray","owner":{"login":"ray-project","id":22125274,"avatar_url":"https://avatars.githubusercontent.com/u/22125274?v=3","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},"private":false,"html_url":"https://github.com/ray-project/ray","description":"An experimental distributed execution engine","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":"2017-01-20T03:08:42Z","pushed_at":"2017-01-20T07:41:24Z","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":"","size":2857,"stargazers_count":18,"watchers_count":18,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":22,"forks":13,"open_issues":22,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ray-project/ray/pulls/219"},"html":{"href":"https://github.com/ray-project/ray/pull/219"},"issue":{"href":"https://api.github.com/repos/ray-project/ray/issues/219"},"comments":{"href":"https://api.github.com/repos/ray-project/ray/issues/219/comments"},"review_comments":{"href":"https://api.github.com/repos/ray-project/ray/pulls/219/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/219/commits"},"statuses":{"href":"https://api.github.com/repos/ray-project/ray/statuses/9ab5d94524fb6ad7b1d6cc16abd79c20acbf927d"}}}}
{"actor":{"display_login":"pcmoritz"}}