{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/329","repository_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins","labels_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/329/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/329/comments","events_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/329/events","html_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/329","id":184138536,"number":329,"title":"Cron Parallelization","user":{"login":"ethitter","id":321503,"avatar_url":"https://avatars.githubusercontent.com/u/321503?v=3","gravatar_id":"","url":"https://api.github.com/users/ethitter","html_url":"https://github.com/ethitter","followers_url":"https://api.github.com/users/ethitter/followers","following_url":"https://api.github.com/users/ethitter/following{/other_user}","gists_url":"https://api.github.com/users/ethitter/gists{/gist_id}","starred_url":"https://api.github.com/users/ethitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethitter/subscriptions","organizations_url":"https://api.github.com/users/ethitter/orgs","repos_url":"https://api.github.com/users/ethitter/repos","events_url":"https://api.github.com/users/ethitter/events{/privacy}","received_events_url":"https://api.github.com/users/ethitter/received_events","type":"User","site_admin":false},"labels":[{"id":309838383,"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/labels/needs%20review","name":"needs review","color":"eb6420","default":false},{"id":328261731,"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/labels/schedule:%20current%20sprint","name":"schedule: current sprint","color":"00cc00","default":false}],"state":"open","locked":false,"assignee":{"login":"ethitter","id":321503,"avatar_url":"https://avatars.githubusercontent.com/u/321503?v=3","gravatar_id":"","url":"https://api.github.com/users/ethitter","html_url":"https://github.com/ethitter","followers_url":"https://api.github.com/users/ethitter/followers","following_url":"https://api.github.com/users/ethitter/following{/other_user}","gists_url":"https://api.github.com/users/ethitter/gists{/gist_id}","starred_url":"https://api.github.com/users/ethitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethitter/subscriptions","organizations_url":"https://api.github.com/users/ethitter/orgs","repos_url":"https://api.github.com/users/ethitter/repos","events_url":"https://api.github.com/users/ethitter/events{/privacy}","received_events_url":"https://api.github.com/users/ethitter/received_events","type":"User","site_admin":false},"assignees":[{"login":"ethitter","id":321503,"avatar_url":"https://avatars.githubusercontent.com/u/321503?v=3","gravatar_id":"","url":"https://api.github.com/users/ethitter","html_url":"https://github.com/ethitter","followers_url":"https://api.github.com/users/ethitter/followers","following_url":"https://api.github.com/users/ethitter/following{/other_user}","gists_url":"https://api.github.com/users/ethitter/gists{/gist_id}","starred_url":"https://api.github.com/users/ethitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethitter/subscriptions","organizations_url":"https://api.github.com/users/ethitter/orgs","repos_url":"https://api.github.com/users/ethitter/repos","events_url":"https://api.github.com/users/ethitter/events{/privacy}","received_events_url":"https://api.github.com/users/ethitter/received_events","type":"User","site_admin":false}],"milestone":null,"comments":15,"created_at":"2016-10-20T05:30:41Z","updated_at":"2016-11-15T06:07:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/329","html_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/329","diff_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/329.diff","patch_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/329.patch"},"body":"Rather than executing scheduled cron tasks in series, multiple tasks can run simultaneously, preventing long-running tasks from blocking other events. \r\n\r\n**How**\r\n1. An endpoint provides a list of tasks to run in the next 60 seconds. Enough information about each is provided to identify it, but its specific arguments are not exposed.\r\n2. A second endpoint accepts the JSON object for an individual task. After confirming that it isn't scheduled more than 15 seconds ahead of the current time, the endpoint runs that job, mimicking the environment Core provides.\r\n3. The existing runners on WordPress.com are updated to use these two endpoints. For each cron task to run, an individual job will be queued on WordPress.com's jobs system.\r\n\r\n_All_ attempts to execute Core's native cron methods (`wp-cron.php`, `wp_cron()`, `spawn_cron()`) are blocked to prevent rogue execution.\r\n\r\n**Remaining issues:**\r\n- [x] Confirm all appropriate constants and PHP runtime calls are made\r\n- [x] Scheduled-post validation\r\n- [x] Force-publishing for missed schedules\r\n- [ ] Request validation via IP\r\n- [x] Limit concurrency\r\n- [ ] Proper endpoint authentication\r\n\r\n**Considerations**\r\n1. A task could run up to 15 seconds early; this seems better than it running late. Returning the next 60-seconds' worth of jobs, but only running those scheduled for the next 15 seconds, is designed to compensate for delays in the process of requesting tasks and scheduling their runners.\r\n2. The name of each job's action is exposed in the endpoint. Is this a concern? If so, the names can be hashed server-side.\r\n3. If the plugin creates jobs, these shouldn't diminish the portion of `$batch_size` that are dedicated to client jobs.\r\n"},"comment":{"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/comments/260555878","html_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/329#issuecomment-260555878","issue_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/329","id":260555878,"user":{"login":"mjangda","id":86105,"avatar_url":"https://avatars.githubusercontent.com/u/86105?v=3","gravatar_id":"","url":"https://api.github.com/users/mjangda","html_url":"https://github.com/mjangda","followers_url":"https://api.github.com/users/mjangda/followers","following_url":"https://api.github.com/users/mjangda/following{/other_user}","gists_url":"https://api.github.com/users/mjangda/gists{/gist_id}","starred_url":"https://api.github.com/users/mjangda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjangda/subscriptions","organizations_url":"https://api.github.com/users/mjangda/orgs","repos_url":"https://api.github.com/users/mjangda/repos","events_url":"https://api.github.com/users/mjangda/events{/privacy}","received_events_url":"https://api.github.com/users/mjangda/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T06:07:17Z","updated_at":"2016-11-15T06:07:17Z","body":"Sweet, will take a look."}}
{"actor":{"display_login":"mjangda"}}