{"action":"created","comment":{"url":"https://api.github.com/repos/AppScale/appscale/pulls/comments/179864815","pull_request_review_id":110195335,"id":179864815,"diff_hunk":"@@ -4996,6 +4907,52 @@ def find_lowest_free_port(starting_port)\n   end\n \n \n+  # Updates @app_info_map with registered instances. This must be called under\n+  # APPS_LOCK.\n+  #\n+  # Args:\n+  #   version_key: A string specifying the version key to update.\n+  def update_registered_instances(version_key)\n+    begin\n+      zk_instances = ZKInterface.get_children(\n+        \"/appscale/instances_by_version/#{version_key}\")\n+    rescue FailedZooKeeperOperationException\n+      Djinn.log_warn('Unable to fetch list of registered instances.')\n+      return\n+    end\n+\n+    unless zk_instances.empty?\n+      @app_info_map[version_key] = {} unless @app_info_map.key?(version_key)\n+      unless @app_info_map[version_key].key?('appservers')\n+        @app_info_map[version_key]['appservers'] = []\n+      end\n+    end\n+    known_instances = @app_info_map[version_key]['appservers']","path":"AppController/djinn.rb","position":null,"original_position":136,"commit_id":"71e48f45550c118d7167841e7e4cca6576a95584","original_commit_id":"fc1648f3b17bf30df659ebd5294d3b5e62419a9d","user":{"login":"cdonati","id":1923367,"avatar_url":"https://avatars0.githubusercontent.com/u/1923367?v=4","gravatar_id":"","url":"https://api.github.com/users/cdonati","html_url":"https://github.com/cdonati","followers_url":"https://api.github.com/users/cdonati/followers","following_url":"https://api.github.com/users/cdonati/following{/other_user}","gists_url":"https://api.github.com/users/cdonati/gists{/gist_id}","starred_url":"https://api.github.com/users/cdonati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdonati/subscriptions","organizations_url":"https://api.github.com/users/cdonati/orgs","repos_url":"https://api.github.com/users/cdonati/repos","events_url":"https://api.github.com/users/cdonati/events{/privacy}","received_events_url":"https://api.github.com/users/cdonati/received_events","type":"User","site_admin":false},"body":"Good point. There's no reason to avoid populating that if it doesn't exit.","created_at":"2018-04-06T20:15:37Z","updated_at":"2018-04-06T20:15:37Z","html_url":"https://github.com/AppScale/appscale/pull/2655#discussion_r179864815","pull_request_url":"https://api.github.com/repos/AppScale/appscale/pulls/2655","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/comments/179864815"},"html":{"href":"https://github.com/AppScale/appscale/pull/2655#discussion_r179864815"},"pull_request":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2655"}},"in_reply_to_id":179841994},"pull_request":{"url":"https://api.github.com/repos/AppScale/appscale/pulls/2655","id":166332630,"html_url":"https://github.com/AppScale/appscale/pull/2655","diff_url":"https://github.com/AppScale/appscale/pull/2655.diff","patch_url":"https://github.com/AppScale/appscale/pull/2655.patch","issue_url":"https://api.github.com/repos/AppScale/appscale/issues/2655","number":2655,"state":"open","locked":false,"title":"Register instances with ZooKeeper","user":{"login":"cdonati","id":1923367,"avatar_url":"https://avatars0.githubusercontent.com/u/1923367?v=4","gravatar_id":"","url":"https://api.github.com/users/cdonati","html_url":"https://github.com/cdonati","followers_url":"https://api.github.com/users/cdonati/followers","following_url":"https://api.github.com/users/cdonati/following{/other_user}","gists_url":"https://api.github.com/users/cdonati/gists{/gist_id}","starred_url":"https://api.github.com/users/cdonati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdonati/subscriptions","organizations_url":"https://api.github.com/users/cdonati/orgs","repos_url":"https://api.github.com/users/cdonati/repos","events_url":"https://api.github.com/users/cdonati/events{/privacy}","received_events_url":"https://api.github.com/users/cdonati/received_events","type":"User","site_admin":false},"body":"This replaces the HTTP callback that the AppManager server used to perform to register an AppServer instance.\r\n\r\nWhile similar to https://github.com/AppScale/appscale/pull/2640, it addresses the code review comments and moves the instance health check from the router to the AppManager.","created_at":"2018-01-31T17:54:21Z","updated_at":"2018-04-06T20:15:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9bbe704bcdea833674321d7e222740fa4d5b5b75","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":587590293,"url":"https://api.github.com/repos/AppScale/appscale/labels/Status:%20Demo%20requested","name":"Status: Demo requested","color":"1d76db","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/AppScale/appscale/pulls/2655/commits","review_comments_url":"https://api.github.com/repos/AppScale/appscale/pulls/2655/comments","review_comment_url":"https://api.github.com/repos/AppScale/appscale/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AppScale/appscale/issues/2655/comments","statuses_url":"https://api.github.com/repos/AppScale/appscale/statuses/71e48f45550c118d7167841e7e4cca6576a95584","head":{"label":"cdonati:register-instances-zk","ref":"register-instances-zk","sha":"71e48f45550c118d7167841e7e4cca6576a95584","user":{"login":"cdonati","id":1923367,"avatar_url":"https://avatars0.githubusercontent.com/u/1923367?v=4","gravatar_id":"","url":"https://api.github.com/users/cdonati","html_url":"https://github.com/cdonati","followers_url":"https://api.github.com/users/cdonati/followers","following_url":"https://api.github.com/users/cdonati/following{/other_user}","gists_url":"https://api.github.com/users/cdonati/gists{/gist_id}","starred_url":"https://api.github.com/users/cdonati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdonati/subscriptions","organizations_url":"https://api.github.com/users/cdonati/orgs","repos_url":"https://api.github.com/users/cdonati/repos","events_url":"https://api.github.com/users/cdonati/events{/privacy}","received_events_url":"https://api.github.com/users/cdonati/received_events","type":"User","site_admin":false},"repo":{"id":22828964,"name":"appscale","full_name":"cdonati/appscale","owner":{"login":"cdonati","id":1923367,"avatar_url":"https://avatars0.githubusercontent.com/u/1923367?v=4","gravatar_id":"","url":"https://api.github.com/users/cdonati","html_url":"https://github.com/cdonati","followers_url":"https://api.github.com/users/cdonati/followers","following_url":"https://api.github.com/users/cdonati/following{/other_user}","gists_url":"https://api.github.com/users/cdonati/gists{/gist_id}","starred_url":"https://api.github.com/users/cdonati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdonati/subscriptions","organizations_url":"https://api.github.com/users/cdonati/orgs","repos_url":"https://api.github.com/users/cdonati/repos","events_url":"https://api.github.com/users/cdonati/events{/privacy}","received_events_url":"https://api.github.com/users/cdonati/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cdonati/appscale","description":"The Open Source Implementation of Google App Engine -- Take your apps everywhere.","fork":true,"url":"https://api.github.com/repos/cdonati/appscale","forks_url":"https://api.github.com/repos/cdonati/appscale/forks","keys_url":"https://api.github.com/repos/cdonati/appscale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cdonati/appscale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cdonati/appscale/teams","hooks_url":"https://api.github.com/repos/cdonati/appscale/hooks","issue_events_url":"https://api.github.com/repos/cdonati/appscale/issues/events{/number}","events_url":"https://api.github.com/repos/cdonati/appscale/events","assignees_url":"https://api.github.com/repos/cdonati/appscale/assignees{/user}","branches_url":"https://api.github.com/repos/cdonati/appscale/branches{/branch}","tags_url":"https://api.github.com/repos/cdonati/appscale/tags","blobs_url":"https://api.github.com/repos/cdonati/appscale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cdonati/appscale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cdonati/appscale/git/refs{/sha}","trees_url":"https://api.github.com/repos/cdonati/appscale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cdonati/appscale/statuses/{sha}","languages_url":"https://api.github.com/repos/cdonati/appscale/languages","stargazers_url":"https://api.github.com/repos/cdonati/appscale/stargazers","contributors_url":"https://api.github.com/repos/cdonati/appscale/contributors","subscribers_url":"https://api.github.com/repos/cdonati/appscale/subscribers","subscription_url":"https://api.github.com/repos/cdonati/appscale/subscription","commits_url":"https://api.github.com/repos/cdonati/appscale/commits{/sha}","git_commits_url":"https://api.github.com/repos/cdonati/appscale/git/commits{/sha}","comments_url":"https://api.github.com/repos/cdonati/appscale/comments{/number}","issue_comment_url":"https://api.github.com/repos/cdonati/appscale/issues/comments{/number}","contents_url":"https://api.github.com/repos/cdonati/appscale/contents/{+path}","compare_url":"https://api.github.com/repos/cdonati/appscale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cdonati/appscale/merges","archive_url":"https://api.github.com/repos/cdonati/appscale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cdonati/appscale/downloads","issues_url":"https://api.github.com/repos/cdonati/appscale/issues{/number}","pulls_url":"https://api.github.com/repos/cdonati/appscale/pulls{/number}","milestones_url":"https://api.github.com/repos/cdonati/appscale/milestones{/number}","notifications_url":"https://api.github.com/repos/cdonati/appscale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cdonati/appscale/labels{/name}","releases_url":"https://api.github.com/repos/cdonati/appscale/releases{/id}","deployments_url":"https://api.github.com/repos/cdonati/appscale/deployments","created_at":"2014-08-11T06:18:52Z","updated_at":"2017-02-12T23:36:25Z","pushed_at":"2018-04-06T20:13:33Z","git_url":"git://github.com/cdonati/appscale.git","ssh_url":"git@github.com:cdonati/appscale.git","clone_url":"https://github.com/cdonati/appscale.git","svn_url":"https://github.com/cdonati/appscale","homepage":"http://www.appscale.com","size":130588,"stargazers_count":1,"watchers_count":1,"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":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"AppScale:master","ref":"master","sha":"bff3d6a9d42b0c2dd58796c4fc6aa1ddd2c00bcc","user":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars0.githubusercontent.com/u/1486044?v=4","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"repo":{"id":3803067,"name":"appscale","full_name":"AppScale/appscale","owner":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars0.githubusercontent.com/u/1486044?v=4","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AppScale/appscale","description":"AppScale is an easy-to-manage serverless platform for building and running scalable web and mobile applications on any infrastructure.","fork":false,"url":"https://api.github.com/repos/AppScale/appscale","forks_url":"https://api.github.com/repos/AppScale/appscale/forks","keys_url":"https://api.github.com/repos/AppScale/appscale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AppScale/appscale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AppScale/appscale/teams","hooks_url":"https://api.github.com/repos/AppScale/appscale/hooks","issue_events_url":"https://api.github.com/repos/AppScale/appscale/issues/events{/number}","events_url":"https://api.github.com/repos/AppScale/appscale/events","assignees_url":"https://api.github.com/repos/AppScale/appscale/assignees{/user}","branches_url":"https://api.github.com/repos/AppScale/appscale/branches{/branch}","tags_url":"https://api.github.com/repos/AppScale/appscale/tags","blobs_url":"https://api.github.com/repos/AppScale/appscale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AppScale/appscale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AppScale/appscale/git/refs{/sha}","trees_url":"https://api.github.com/repos/AppScale/appscale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AppScale/appscale/statuses/{sha}","languages_url":"https://api.github.com/repos/AppScale/appscale/languages","stargazers_url":"https://api.github.com/repos/AppScale/appscale/stargazers","contributors_url":"https://api.github.com/repos/AppScale/appscale/contributors","subscribers_url":"https://api.github.com/repos/AppScale/appscale/subscribers","subscription_url":"https://api.github.com/repos/AppScale/appscale/subscription","commits_url":"https://api.github.com/repos/AppScale/appscale/commits{/sha}","git_commits_url":"https://api.github.com/repos/AppScale/appscale/git/commits{/sha}","comments_url":"https://api.github.com/repos/AppScale/appscale/comments{/number}","issue_comment_url":"https://api.github.com/repos/AppScale/appscale/issues/comments{/number}","contents_url":"https://api.github.com/repos/AppScale/appscale/contents/{+path}","compare_url":"https://api.github.com/repos/AppScale/appscale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AppScale/appscale/merges","archive_url":"https://api.github.com/repos/AppScale/appscale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AppScale/appscale/downloads","issues_url":"https://api.github.com/repos/AppScale/appscale/issues{/number}","pulls_url":"https://api.github.com/repos/AppScale/appscale/pulls{/number}","milestones_url":"https://api.github.com/repos/AppScale/appscale/milestones{/number}","notifications_url":"https://api.github.com/repos/AppScale/appscale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AppScale/appscale/labels{/name}","releases_url":"https://api.github.com/repos/AppScale/appscale/releases{/id}","deployments_url":"https://api.github.com/repos/AppScale/appscale/deployments","created_at":"2012-03-22T22:35:50Z","updated_at":"2018-04-05T18:28:18Z","pushed_at":"2018-04-06T20:13:35Z","git_url":"git://github.com/AppScale/appscale.git","ssh_url":"git@github.com:AppScale/appscale.git","clone_url":"https://github.com/AppScale/appscale.git","svn_url":"https://github.com/AppScale/appscale","homepage":"https://www.appscale.com/community/","size":130169,"stargazers_count":2317,"watchers_count":2317,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":269,"mirror_url":null,"archived":false,"open_issues_count":38,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":269,"open_issues":38,"watchers":2317,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2655"},"html":{"href":"https://github.com/AppScale/appscale/pull/2655"},"issue":{"href":"https://api.github.com/repos/AppScale/appscale/issues/2655"},"comments":{"href":"https://api.github.com/repos/AppScale/appscale/issues/2655/comments"},"review_comments":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2655/comments"},"review_comment":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2655/commits"},"statuses":{"href":"https://api.github.com/repos/AppScale/appscale/statuses/71e48f45550c118d7167841e7e4cca6576a95584"}},"author_association":"OWNER"}}
{"actor":{"display_login":"cdonati"}}