{"action":"created","comment":{"url":"https://api.github.com/repos/AppScale/appscale/pulls/comments/73606680","id":73606680,"diff_hunk":"@@ -213,51 +214,50 @@ def reload_worker(self, json_request):\n       return json.dumps(request)\n \n     app_id = self.__cleanse(request['app_id'])\n-    config = TaskQueueConfig(TaskQueueConfig.RABBITMQ, app_id)\n \n-    old_queues = self.__queue_info_cache.get(app_id, {'queue': []})\n-    old_queue_dict = {}\n-    for queue in old_queues['queue']:\n-      old_queue_dict[queue['name']] = queue\n-\n-    new_queue_dict = {}\n-    # Load the new queue info.\n+    cached_queues = self.__queue_info_cache[app_id]\n     try:\n-      new_queues  = config.load_queues_from_file(app_id)\n-      for queue in new_queues['queue']:\n-        new_queue_dict[queue['name']] = queue\n-    except ValueError, value_error:\n-      return json.dumps({\"error\": True, \"reason\": str(value_error)}) \n-    except NameError, name_error:\n-      return json.dumps({\"error\": True, \"reason\": str(name_error)}) \n-    except Exception, exception:\n-      logging.error(\"******Unknown exception******\")\n-      logging.exception(exception)\n-      return json.dumps({\"error\": True, \"reason\": str(exception)})\n-\n-    reload_queues = False\n-\n-    # Delete queues that no longer exist.\n-    for queue_name in old_queue_dict.keys():\n-      if queue_name not in new_queue_dict:\n-        logging.info(\"Deleting {0} queue: {1}\".format(app_id, queue_name))\n-        reload_queues = True\n-\n-    # Create any new queues.\n-    for queue_name in new_queue_dict.keys():\n-      if queue_name not in old_queue_dict.keys():\n-        logging.info(\"Creating {0} queue: {1}\".format(app_id, queue_name))\n-        reload_queues = True\n-\n-    if reload_queues:\n-      logging.info(\"Old {0} queues: {1}\".format(app_id, old_queue_dict))\n-      logging.info(\"New {0} queues: {1}\".format(app_id, new_queue_dict))\n+      new_queues = TaskQueueConfig(app_id).queues\n+    except (ValueError, NameError) as config_error:\n+      return json.dumps({'error': True, 'reason': config_error.message})\n+    except Exception as config_error:\n+      logging.exception('Unknown exception')\n+      return json.dumps({'error': True, 'reason': config_error.message})\n+\n+    reload_workers = False\n+\n+    # Stop workers for push queues that no longer exist.\n+    for name, queue in cached_queues.iteritems():\n+      if queue.mode != QueueTypes.PUSH:\n+        continue\n+\n+      if name not in new_queues:\n+        logging.info('Deleting queue for {}: {}'.format(app_id, name))\n+        reload_workers = True\n+\n+    # Create any new push queues and update ones that have changed.\n+    for name, queue in new_queues.iteritems():\n+      if queue.mode != QueueTypes.PUSH:\n+        continue\n+\n+      if name not in cached_queues:\n+        logging.info('Creating queue for {}: {}'.format(app_id, name))\n+        reload_workers = True\n+        continue\n+\n+      if queue != cached_queues[name]:\n+        logging.info('Reloading queue for {}: {}'.format(app_id, name))\n+        logging.info('Old: {}\\nNew: {}'.format(cached_queues[name], queue))","path":"AppTaskQueue/appscale/taskqueue/distributed_tq.py","position":82,"original_position":82,"commit_id":"05ce2d91b8447f4080c106bc8a5660093f4f15f9","original_commit_id":"05ce2d91b8447f4080c106bc8a5660093f4f15f9","user":{"login":"cdonati","id":1923367,"avatar_url":"https://avatars.githubusercontent.com/u/1923367?v=3","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":"Yeah, probably. I'll change it.","created_at":"2016-08-04T21:31:47Z","updated_at":"2016-08-04T21:31:47Z","html_url":"https://github.com/AppScale/appscale/pull/2102#discussion_r73606680","pull_request_url":"https://api.github.com/repos/AppScale/appscale/pulls/2102","_links":{"self":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/comments/73606680"},"html":{"href":"https://github.com/AppScale/appscale/pull/2102#discussion_r73606680"},"pull_request":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2102"}}},"pull_request":{"url":"https://api.github.com/repos/AppScale/appscale/pulls/2102","id":80147603,"html_url":"https://github.com/AppScale/appscale/pull/2102","diff_url":"https://github.com/AppScale/appscale/pull/2102.diff","patch_url":"https://github.com/AppScale/appscale/pull/2102.patch","issue_url":"https://api.github.com/repos/AppScale/appscale/issues/2102","number":2102,"state":"open","locked":false,"title":"Restart workers for queues that change","user":{"login":"cdonati","id":1923367,"avatar_url":"https://avatars.githubusercontent.com/u/1923367?v=3","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":"","created_at":"2016-08-04T20:51:54Z","updated_at":"2016-08-04T21:31:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ae15952943de1f5b77c4615c3acbfdfb35fcdda","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AppScale/appscale/pulls/2102/commits","review_comments_url":"https://api.github.com/repos/AppScale/appscale/pulls/2102/comments","review_comment_url":"https://api.github.com/repos/AppScale/appscale/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AppScale/appscale/issues/2102/comments","statuses_url":"https://api.github.com/repos/AppScale/appscale/statuses/05ce2d91b8447f4080c106bc8a5660093f4f15f9","head":{"label":"cdonati:stricter-reload","ref":"stricter-reload","sha":"05ce2d91b8447f4080c106bc8a5660093f4f15f9","user":{"login":"cdonati","id":1923367,"avatar_url":"https://avatars.githubusercontent.com/u/1923367?v=3","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://avatars.githubusercontent.com/u/1923367?v=3","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":"2016-02-24T02:26:35Z","pushed_at":"2016-08-04T21:19:13Z","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":122937,"stargazers_count":1,"watchers_count":1,"language":"Python","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":1,"default_branch":"master"}},"base":{"label":"AppScale:master","ref":"master","sha":"4c8bb95c54da2682496ba70df1c465f3f619a5cb","user":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars.githubusercontent.com/u/1486044?v=3","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://avatars.githubusercontent.com/u/1486044?v=3","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":"The Open Source Implementation of Google App Engine -- Take your apps everywhere.","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":"2016-07-31T19:28:36Z","pushed_at":"2016-08-04T21:19:14Z","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","size":126245,"stargazers_count":2182,"watchers_count":2182,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":252,"mirror_url":null,"open_issues_count":17,"forks":252,"open_issues":17,"watchers":2182,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2102"},"html":{"href":"https://github.com/AppScale/appscale/pull/2102"},"issue":{"href":"https://api.github.com/repos/AppScale/appscale/issues/2102"},"comments":{"href":"https://api.github.com/repos/AppScale/appscale/issues/2102/comments"},"review_comments":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2102/comments"},"review_comment":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/2102/commits"},"statuses":{"href":"https://api.github.com/repos/AppScale/appscale/statuses/05ce2d91b8447f4080c106bc8a5660093f4f15f9"}}}}
{"actor":{"display_login":"cdonati"}}