{"action":"created","comment":{"url":"https://api.github.com/repos/pulp/pulp/pulls/comments/64961176","id":64961176,"diff_hunk":"@@ -121,30 +113,39 @@ def check_celery_processes(self):\n         present. If there are zero of either, log at the error level that Pulp will not operate\n         correctly.\n         \"\"\"\n-        msg = _('Checking if pulp_workers, pulp_celerybeat, or pulp_resource_manager '\n-                'processes are missing for more than %d seconds') % self.CELERY_TIMEOUT_SECONDS\n+        msg = _('Checking if pulp_workers, pulp_celerybeat, or pulp_resource_manager processes '\n+                'are missing for more than %d seconds') % constants.CELERY_TIMEOUT_SECONDS\n         _logger.debug(msg)\n         now = ensure_tz(datetime.utcnow())\n-        oldest_heartbeat_time = now - timedelta(seconds=self.CELERY_TIMEOUT_SECONDS)\n+        oldest_heartbeat_time = now - timedelta(seconds=constants.CELERY_TIMEOUT_SECONDS)\n         worker_list = Worker.objects.all()\n         worker_count = 0\n         resource_manager_count = 0\n         scheduler_count = 0\n+\n         for worker in worker_list:\n             if worker.last_heartbeat < oldest_heartbeat_time:\n                 msg = _(\"Worker '%s' has gone missing, removing from list of workers\") % worker.name\n                 _logger.error(msg)\n-                _delete_worker(worker.name)\n-            elif worker.name.startswith(SCHEDULER_WORKER_NAME):\n+\n+                # Check if worker is a scheduler, and clean up appropriately","path":"server/pulp/server/async/scheduler.py","position":57,"original_position":57,"commit_id":"72b05d94ad312821c6ddd04805c79ae429774aea","original_commit_id":"72b05d94ad312821c6ddd04805c79ae429774aea","user":{"login":"bmbouter","id":180319,"avatar_url":"https://avatars.githubusercontent.com/u/180319?v=3","gravatar_id":"","url":"https://api.github.com/users/bmbouter","html_url":"https://github.com/bmbouter","followers_url":"https://api.github.com/users/bmbouter/followers","following_url":"https://api.github.com/users/bmbouter/following{/other_user}","gists_url":"https://api.github.com/users/bmbouter/gists{/gist_id}","starred_url":"https://api.github.com/users/bmbouter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmbouter/subscriptions","organizations_url":"https://api.github.com/users/bmbouter/orgs","repos_url":"https://api.github.com/users/bmbouter/repos","events_url":"https://api.github.com/users/bmbouter/events{/privacy}","received_events_url":"https://api.github.com/users/bmbouter/received_events","type":"User","site_admin":false},"body":"Years ago a friend of mine convinced me not to put comments of intent like this because over time they don't get maintained and then they become wrong. Instead he encouraged me to write \"crazy readable code\" which was as precise as code but as readable as text. This is like an implicit comment.\r\n\r\nFor example in this case, `worker.delete()` could be renamed to `worker.delete_db_entry()` and `_delete_worker(worker.name)` could be `_delete_worker_db_cancel_tasks_cleanup_reservations(worker.name)`\r\n\r\nYou don't necessarily have to do all this, I'm just giving an example about readable code.","created_at":"2016-05-27T20:17:18Z","updated_at":"2016-05-27T20:17:18Z","html_url":"https://github.com/pulp/pulp/pull/2589#discussion_r64961176","pull_request_url":"https://api.github.com/repos/pulp/pulp/pulls/2589","_links":{"self":{"href":"https://api.github.com/repos/pulp/pulp/pulls/comments/64961176"},"html":{"href":"https://github.com/pulp/pulp/pull/2589#discussion_r64961176"},"pull_request":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2589"}}},"pull_request":{"url":"https://api.github.com/repos/pulp/pulp/pulls/2589","id":71762881,"html_url":"https://github.com/pulp/pulp/pull/2589","diff_url":"https://github.com/pulp/pulp/pull/2589.diff","patch_url":"https://github.com/pulp/pulp/pull/2589.patch","issue_url":"https://api.github.com/repos/pulp/pulp/issues/2589","number":2589,"state":"open","locked":false,"title":"Issue #1113: If an instance of pulp_celerybeat dies unexpectedly, Pulp incorrectly tries to \"cancel all tasks in its queue\"","user":{"login":"dralley","id":2751996,"avatar_url":"https://avatars.githubusercontent.com/u/2751996?v=3","gravatar_id":"","url":"https://api.github.com/users/dralley","html_url":"https://github.com/dralley","followers_url":"https://api.github.com/users/dralley/followers","following_url":"https://api.github.com/users/dralley/following{/other_user}","gists_url":"https://api.github.com/users/dralley/gists{/gist_id}","starred_url":"https://api.github.com/users/dralley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dralley/subscriptions","organizations_url":"https://api.github.com/users/dralley/orgs","repos_url":"https://api.github.com/users/dralley/repos","events_url":"https://api.github.com/users/dralley/events{/privacy}","received_events_url":"https://api.github.com/users/dralley/received_events","type":"User","site_admin":false},"body":"Fixes a bug wherein duplicate celerybeat instances will see one or the other going offline as a worker going offline and treats them as such.  Hence, it will try to delete the scheduler's work queue and prints a misleading error message.\r\n\r\nhttps://pulp.plan.io/issues/1113","created_at":"2016-05-27T19:38:29Z","updated_at":"2016-05-27T20:17:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3bb97511711ea0f415f274c771b1bfc0021a65de","assignee":{"login":"bmbouter","id":180319,"avatar_url":"https://avatars.githubusercontent.com/u/180319?v=3","gravatar_id":"","url":"https://api.github.com/users/bmbouter","html_url":"https://github.com/bmbouter","followers_url":"https://api.github.com/users/bmbouter/followers","following_url":"https://api.github.com/users/bmbouter/following{/other_user}","gists_url":"https://api.github.com/users/bmbouter/gists{/gist_id}","starred_url":"https://api.github.com/users/bmbouter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmbouter/subscriptions","organizations_url":"https://api.github.com/users/bmbouter/orgs","repos_url":"https://api.github.com/users/bmbouter/repos","events_url":"https://api.github.com/users/bmbouter/events{/privacy}","received_events_url":"https://api.github.com/users/bmbouter/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/pulp/pulp/pulls/2589/commits","review_comments_url":"https://api.github.com/repos/pulp/pulp/pulls/2589/comments","review_comment_url":"https://api.github.com/repos/pulp/pulp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pulp/pulp/issues/2589/comments","statuses_url":"https://api.github.com/repos/pulp/pulp/statuses/72b05d94ad312821c6ddd04805c79ae429774aea","head":{"label":"dralley:2.8-dev","ref":"2.8-dev","sha":"72b05d94ad312821c6ddd04805c79ae429774aea","user":{"login":"dralley","id":2751996,"avatar_url":"https://avatars.githubusercontent.com/u/2751996?v=3","gravatar_id":"","url":"https://api.github.com/users/dralley","html_url":"https://github.com/dralley","followers_url":"https://api.github.com/users/dralley/followers","following_url":"https://api.github.com/users/dralley/following{/other_user}","gists_url":"https://api.github.com/users/dralley/gists{/gist_id}","starred_url":"https://api.github.com/users/dralley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dralley/subscriptions","organizations_url":"https://api.github.com/users/dralley/orgs","repos_url":"https://api.github.com/users/dralley/repos","events_url":"https://api.github.com/users/dralley/events{/privacy}","received_events_url":"https://api.github.com/users/dralley/received_events","type":"User","site_admin":false},"repo":{"id":59848891,"name":"pulp","full_name":"dralley/pulp","owner":{"login":"dralley","id":2751996,"avatar_url":"https://avatars.githubusercontent.com/u/2751996?v=3","gravatar_id":"","url":"https://api.github.com/users/dralley","html_url":"https://github.com/dralley","followers_url":"https://api.github.com/users/dralley/followers","following_url":"https://api.github.com/users/dralley/following{/other_user}","gists_url":"https://api.github.com/users/dralley/gists{/gist_id}","starred_url":"https://api.github.com/users/dralley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dralley/subscriptions","organizations_url":"https://api.github.com/users/dralley/orgs","repos_url":"https://api.github.com/users/dralley/repos","events_url":"https://api.github.com/users/dralley/events{/privacy}","received_events_url":"https://api.github.com/users/dralley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dralley/pulp","description":"Repository for Pulp platform code, including the server and base admin and consumer clients","fork":true,"url":"https://api.github.com/repos/dralley/pulp","forks_url":"https://api.github.com/repos/dralley/pulp/forks","keys_url":"https://api.github.com/repos/dralley/pulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dralley/pulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dralley/pulp/teams","hooks_url":"https://api.github.com/repos/dralley/pulp/hooks","issue_events_url":"https://api.github.com/repos/dralley/pulp/issues/events{/number}","events_url":"https://api.github.com/repos/dralley/pulp/events","assignees_url":"https://api.github.com/repos/dralley/pulp/assignees{/user}","branches_url":"https://api.github.com/repos/dralley/pulp/branches{/branch}","tags_url":"https://api.github.com/repos/dralley/pulp/tags","blobs_url":"https://api.github.com/repos/dralley/pulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dralley/pulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dralley/pulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/dralley/pulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dralley/pulp/statuses/{sha}","languages_url":"https://api.github.com/repos/dralley/pulp/languages","stargazers_url":"https://api.github.com/repos/dralley/pulp/stargazers","contributors_url":"https://api.github.com/repos/dralley/pulp/contributors","subscribers_url":"https://api.github.com/repos/dralley/pulp/subscribers","subscription_url":"https://api.github.com/repos/dralley/pulp/subscription","commits_url":"https://api.github.com/repos/dralley/pulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/dralley/pulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/dralley/pulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/dralley/pulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/dralley/pulp/contents/{+path}","compare_url":"https://api.github.com/repos/dralley/pulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dralley/pulp/merges","archive_url":"https://api.github.com/repos/dralley/pulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dralley/pulp/downloads","issues_url":"https://api.github.com/repos/dralley/pulp/issues{/number}","pulls_url":"https://api.github.com/repos/dralley/pulp/pulls{/number}","milestones_url":"https://api.github.com/repos/dralley/pulp/milestones{/number}","notifications_url":"https://api.github.com/repos/dralley/pulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dralley/pulp/labels{/name}","releases_url":"https://api.github.com/repos/dralley/pulp/releases{/id}","deployments_url":"https://api.github.com/repos/dralley/pulp/deployments","created_at":"2016-05-27T16:35:44Z","updated_at":"2016-05-27T16:35:49Z","pushed_at":"2016-05-27T20:06:07Z","git_url":"git://github.com/dralley/pulp.git","ssh_url":"git@github.com:dralley/pulp.git","clone_url":"https://github.com/dralley/pulp.git","svn_url":"https://github.com/dralley/pulp","homepage":"","size":91346,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"pulp:2.8-dev","ref":"2.8-dev","sha":"a66230b9bed8bf77d82343031f4c57f9b4f1489b","user":{"login":"pulp","id":2103606,"avatar_url":"https://avatars.githubusercontent.com/u/2103606?v=3","gravatar_id":"","url":"https://api.github.com/users/pulp","html_url":"https://github.com/pulp","followers_url":"https://api.github.com/users/pulp/followers","following_url":"https://api.github.com/users/pulp/following{/other_user}","gists_url":"https://api.github.com/users/pulp/gists{/gist_id}","starred_url":"https://api.github.com/users/pulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pulp/subscriptions","organizations_url":"https://api.github.com/users/pulp/orgs","repos_url":"https://api.github.com/users/pulp/repos","events_url":"https://api.github.com/users/pulp/events{/privacy}","received_events_url":"https://api.github.com/users/pulp/received_events","type":"Organization","site_admin":false},"repo":{"id":5314652,"name":"pulp","full_name":"pulp/pulp","owner":{"login":"pulp","id":2103606,"avatar_url":"https://avatars.githubusercontent.com/u/2103606?v=3","gravatar_id":"","url":"https://api.github.com/users/pulp","html_url":"https://github.com/pulp","followers_url":"https://api.github.com/users/pulp/followers","following_url":"https://api.github.com/users/pulp/following{/other_user}","gists_url":"https://api.github.com/users/pulp/gists{/gist_id}","starred_url":"https://api.github.com/users/pulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pulp/subscriptions","organizations_url":"https://api.github.com/users/pulp/orgs","repos_url":"https://api.github.com/users/pulp/repos","events_url":"https://api.github.com/users/pulp/events{/privacy}","received_events_url":"https://api.github.com/users/pulp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pulp/pulp","description":"Repository for Pulp platform code, including the server and base admin and consumer clients","fork":false,"url":"https://api.github.com/repos/pulp/pulp","forks_url":"https://api.github.com/repos/pulp/pulp/forks","keys_url":"https://api.github.com/repos/pulp/pulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pulp/pulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pulp/pulp/teams","hooks_url":"https://api.github.com/repos/pulp/pulp/hooks","issue_events_url":"https://api.github.com/repos/pulp/pulp/issues/events{/number}","events_url":"https://api.github.com/repos/pulp/pulp/events","assignees_url":"https://api.github.com/repos/pulp/pulp/assignees{/user}","branches_url":"https://api.github.com/repos/pulp/pulp/branches{/branch}","tags_url":"https://api.github.com/repos/pulp/pulp/tags","blobs_url":"https://api.github.com/repos/pulp/pulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pulp/pulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pulp/pulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/pulp/pulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pulp/pulp/statuses/{sha}","languages_url":"https://api.github.com/repos/pulp/pulp/languages","stargazers_url":"https://api.github.com/repos/pulp/pulp/stargazers","contributors_url":"https://api.github.com/repos/pulp/pulp/contributors","subscribers_url":"https://api.github.com/repos/pulp/pulp/subscribers","subscription_url":"https://api.github.com/repos/pulp/pulp/subscription","commits_url":"https://api.github.com/repos/pulp/pulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/pulp/pulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/pulp/pulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/pulp/pulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/pulp/pulp/contents/{+path}","compare_url":"https://api.github.com/repos/pulp/pulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pulp/pulp/merges","archive_url":"https://api.github.com/repos/pulp/pulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pulp/pulp/downloads","issues_url":"https://api.github.com/repos/pulp/pulp/issues{/number}","pulls_url":"https://api.github.com/repos/pulp/pulp/pulls{/number}","milestones_url":"https://api.github.com/repos/pulp/pulp/milestones{/number}","notifications_url":"https://api.github.com/repos/pulp/pulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pulp/pulp/labels{/name}","releases_url":"https://api.github.com/repos/pulp/pulp/releases{/id}","deployments_url":"https://api.github.com/repos/pulp/pulp/deployments","created_at":"2012-08-06T13:49:20Z","updated_at":"2016-04-28T23:19:54Z","pushed_at":"2016-05-27T20:06:08Z","git_url":"git://github.com/pulp/pulp.git","ssh_url":"git@github.com:pulp/pulp.git","clone_url":"https://github.com/pulp/pulp.git","svn_url":"https://github.com/pulp/pulp","homepage":"","size":103328,"stargazers_count":265,"watchers_count":265,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":105,"mirror_url":null,"open_issues_count":17,"forks":105,"open_issues":17,"watchers":265,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2589"},"html":{"href":"https://github.com/pulp/pulp/pull/2589"},"issue":{"href":"https://api.github.com/repos/pulp/pulp/issues/2589"},"comments":{"href":"https://api.github.com/repos/pulp/pulp/issues/2589/comments"},"review_comments":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2589/comments"},"review_comment":{"href":"https://api.github.com/repos/pulp/pulp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2589/commits"},"statuses":{"href":"https://api.github.com/repos/pulp/pulp/statuses/72b05d94ad312821c6ddd04805c79ae429774aea"}}}}
{"actor":{"display_login":"bmbouter"}}