{"action":"opened","number":23273,"pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/23273","id":34558177,"html_url":"https://github.com/saltstack/salt/pull/23273","diff_url":"https://github.com/saltstack/salt/pull/23273.diff","patch_url":"https://github.com/saltstack/salt/pull/23273.patch","issue_url":"https://api.github.com/repos/saltstack/salt/issues/23273","number":23273,"state":"open","locked":false,"title":"use ctime for old jobs cleanup in local cache returner","user":{"login":"jodv","id":2186037,"avatar_url":"https://avatars.githubusercontent.com/u/2186037?v=3","gravatar_id":"","url":"https://api.github.com/users/jodv","html_url":"https://github.com/jodv","followers_url":"https://api.github.com/users/jodv/followers","following_url":"https://api.github.com/users/jodv/following{/other_user}","gists_url":"https://api.github.com/users/jodv/gists{/gist_id}","starred_url":"https://api.github.com/users/jodv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodv/subscriptions","organizations_url":"https://api.github.com/users/jodv/orgs","repos_url":"https://api.github.com/users/jodv/repos","events_url":"https://api.github.com/users/jodv/events{/privacy}","received_events_url":"https://api.github.com/users/jodv/received_events","type":"User","site_admin":false},"body":"The clean_old_jobs() method for the local_cache returner is pretty slow since it has to open a filehandle and do a read for every job in the cache.\r\n\r\nThe ctime of the jid file is roughly equivalent to the timestamp recorded in the jid and by using that as the basis for comparison, we can gain a 5x performance improvement on the clean_old_jobs() run.\r\n\r\nThe only functionality we lose is the ability to preemptively prune cached jobs with invalid/corrupted jids vs. letting them expire from normal retention configuration (since we don't actually read the jid), but I'm of the opinion that this is a worthwhile tradeoff for the perf improvement.","created_at":"2015-05-01T18:55:18Z","updated_at":"2015-05-01T18:55:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/saltstack/salt/pulls/23273/commits","review_comments_url":"https://api.github.com/repos/saltstack/salt/pulls/23273/comments","review_comment_url":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/23273/comments","statuses_url":"https://api.github.com/repos/saltstack/salt/statuses/d42a83cc14d308c72f671b45d412d57187251102","head":{"label":"jodv:localcache_fast_cleanup","ref":"localcache_fast_cleanup","sha":"d42a83cc14d308c72f671b45d412d57187251102","user":{"login":"jodv","id":2186037,"avatar_url":"https://avatars.githubusercontent.com/u/2186037?v=3","gravatar_id":"","url":"https://api.github.com/users/jodv","html_url":"https://github.com/jodv","followers_url":"https://api.github.com/users/jodv/followers","following_url":"https://api.github.com/users/jodv/following{/other_user}","gists_url":"https://api.github.com/users/jodv/gists{/gist_id}","starred_url":"https://api.github.com/users/jodv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodv/subscriptions","organizations_url":"https://api.github.com/users/jodv/orgs","repos_url":"https://api.github.com/users/jodv/repos","events_url":"https://api.github.com/users/jodv/events{/privacy}","received_events_url":"https://api.github.com/users/jodv/received_events","type":"User","site_admin":false},"repo":{"id":24706728,"name":"salt","full_name":"jodv/salt","owner":{"login":"jodv","id":2186037,"avatar_url":"https://avatars.githubusercontent.com/u/2186037?v=3","gravatar_id":"","url":"https://api.github.com/users/jodv","html_url":"https://github.com/jodv","followers_url":"https://api.github.com/users/jodv/followers","following_url":"https://api.github.com/users/jodv/following{/other_user}","gists_url":"https://api.github.com/users/jodv/gists{/gist_id}","starred_url":"https://api.github.com/users/jodv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodv/subscriptions","organizations_url":"https://api.github.com/users/jodv/orgs","repos_url":"https://api.github.com/users/jodv/repos","events_url":"https://api.github.com/users/jodv/events{/privacy}","received_events_url":"https://api.github.com/users/jodv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jodv/salt","description":"Infrastructure automation and management system","fork":true,"url":"https://api.github.com/repos/jodv/salt","forks_url":"https://api.github.com/repos/jodv/salt/forks","keys_url":"https://api.github.com/repos/jodv/salt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jodv/salt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jodv/salt/teams","hooks_url":"https://api.github.com/repos/jodv/salt/hooks","issue_events_url":"https://api.github.com/repos/jodv/salt/issues/events{/number}","events_url":"https://api.github.com/repos/jodv/salt/events","assignees_url":"https://api.github.com/repos/jodv/salt/assignees{/user}","branches_url":"https://api.github.com/repos/jodv/salt/branches{/branch}","tags_url":"https://api.github.com/repos/jodv/salt/tags","blobs_url":"https://api.github.com/repos/jodv/salt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jodv/salt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jodv/salt/git/refs{/sha}","trees_url":"https://api.github.com/repos/jodv/salt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jodv/salt/statuses/{sha}","languages_url":"https://api.github.com/repos/jodv/salt/languages","stargazers_url":"https://api.github.com/repos/jodv/salt/stargazers","contributors_url":"https://api.github.com/repos/jodv/salt/contributors","subscribers_url":"https://api.github.com/repos/jodv/salt/subscribers","subscription_url":"https://api.github.com/repos/jodv/salt/subscription","commits_url":"https://api.github.com/repos/jodv/salt/commits{/sha}","git_commits_url":"https://api.github.com/repos/jodv/salt/git/commits{/sha}","comments_url":"https://api.github.com/repos/jodv/salt/comments{/number}","issue_comment_url":"https://api.github.com/repos/jodv/salt/issues/comments{/number}","contents_url":"https://api.github.com/repos/jodv/salt/contents/{+path}","compare_url":"https://api.github.com/repos/jodv/salt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jodv/salt/merges","archive_url":"https://api.github.com/repos/jodv/salt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jodv/salt/downloads","issues_url":"https://api.github.com/repos/jodv/salt/issues{/number}","pulls_url":"https://api.github.com/repos/jodv/salt/pulls{/number}","milestones_url":"https://api.github.com/repos/jodv/salt/milestones{/number}","notifications_url":"https://api.github.com/repos/jodv/salt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jodv/salt/labels{/name}","releases_url":"https://api.github.com/repos/jodv/salt/releases{/id}","created_at":"2014-10-02T04:44:42Z","updated_at":"2015-04-28T06:31:43Z","pushed_at":"2015-05-01T18:38:13Z","git_url":"git://github.com/jodv/salt.git","ssh_url":"git@github.com:jodv/salt.git","clone_url":"https://github.com/jodv/salt.git","svn_url":"https://github.com/jodv/salt","homepage":"saltstack.com","size":99726,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"develop"}},"base":{"label":"saltstack:develop","ref":"develop","sha":"b76807addc637f26cb01365e6576e148f4c7c01e","user":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars.githubusercontent.com/u/1147473?v=3","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"repo":{"id":1390248,"name":"salt","full_name":"saltstack/salt","owner":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars.githubusercontent.com/u/1147473?v=3","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/saltstack/salt","description":"Infrastructure automation and management system","fork":false,"url":"https://api.github.com/repos/saltstack/salt","forks_url":"https://api.github.com/repos/saltstack/salt/forks","keys_url":"https://api.github.com/repos/saltstack/salt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/saltstack/salt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/saltstack/salt/teams","hooks_url":"https://api.github.com/repos/saltstack/salt/hooks","issue_events_url":"https://api.github.com/repos/saltstack/salt/issues/events{/number}","events_url":"https://api.github.com/repos/saltstack/salt/events","assignees_url":"https://api.github.com/repos/saltstack/salt/assignees{/user}","branches_url":"https://api.github.com/repos/saltstack/salt/branches{/branch}","tags_url":"https://api.github.com/repos/saltstack/salt/tags","blobs_url":"https://api.github.com/repos/saltstack/salt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/saltstack/salt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/saltstack/salt/git/refs{/sha}","trees_url":"https://api.github.com/repos/saltstack/salt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/saltstack/salt/statuses/{sha}","languages_url":"https://api.github.com/repos/saltstack/salt/languages","stargazers_url":"https://api.github.com/repos/saltstack/salt/stargazers","contributors_url":"https://api.github.com/repos/saltstack/salt/contributors","subscribers_url":"https://api.github.com/repos/saltstack/salt/subscribers","subscription_url":"https://api.github.com/repos/saltstack/salt/subscription","commits_url":"https://api.github.com/repos/saltstack/salt/commits{/sha}","git_commits_url":"https://api.github.com/repos/saltstack/salt/git/commits{/sha}","comments_url":"https://api.github.com/repos/saltstack/salt/comments{/number}","issue_comment_url":"https://api.github.com/repos/saltstack/salt/issues/comments{/number}","contents_url":"https://api.github.com/repos/saltstack/salt/contents/{+path}","compare_url":"https://api.github.com/repos/saltstack/salt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/saltstack/salt/merges","archive_url":"https://api.github.com/repos/saltstack/salt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/saltstack/salt/downloads","issues_url":"https://api.github.com/repos/saltstack/salt/issues{/number}","pulls_url":"https://api.github.com/repos/saltstack/salt/pulls{/number}","milestones_url":"https://api.github.com/repos/saltstack/salt/milestones{/number}","notifications_url":"https://api.github.com/repos/saltstack/salt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/saltstack/salt/labels{/name}","releases_url":"https://api.github.com/repos/saltstack/salt/releases{/id}","created_at":"2011-02-20T20:16:56Z","updated_at":"2015-05-01T17:36:43Z","pushed_at":"2015-05-01T18:42:03Z","git_url":"git://github.com/saltstack/salt.git","ssh_url":"git@github.com:saltstack/salt.git","clone_url":"https://github.com/saltstack/salt.git","svn_url":"https://github.com/saltstack/salt","homepage":"saltstack.com","size":220671,"stargazers_count":5078,"watchers_count":5078,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2117,"mirror_url":null,"open_issues_count":2517,"forks":2117,"open_issues":2517,"watchers":5078,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/saltstack/salt/pulls/23273"},"html":{"href":"https://github.com/saltstack/salt/pull/23273"},"issue":{"href":"https://api.github.com/repos/saltstack/salt/issues/23273"},"comments":{"href":"https://api.github.com/repos/saltstack/salt/issues/23273/comments"},"review_comments":{"href":"https://api.github.com/repos/saltstack/salt/pulls/23273/comments"},"review_comment":{"href":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/saltstack/salt/pulls/23273/commits"},"statuses":{"href":"https://api.github.com/repos/saltstack/salt/statuses/d42a83cc14d308c72f671b45d412d57187251102"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":6,"deletions":25,"changed_files":1}}