{"action":"created","comment":{"url":"https://api.github.com/repos/mesos/chronos/pulls/comments/29706411","id":29706411,"diff_hunk":"@@ -507,21 +507,24 @@ class JobScheduler @Inject()(val scheduleHorizon: Period,\n           (None, None)\n         } else {\n           val job = jobOption.get\n-          if (nextDate.isAfter(now.minus(job.epsilon)) && nextDate.isBefore(now.plus(scheduleHorizon))) {\n+          val scheduleWindowBegin = now.minus(job.epsilon)\n+          val scheduleWindowEnd = now.plus(scheduleHorizon)\n+          if (nextDate.isAfter(scheduleWindowBegin) && nextDate.isBefore(scheduleWindowEnd)) {\n             log.info(\"Task ready for scheduling: %s\".format(nextDate))\n             //TODO(FL): Rethink passing the dispatch queue all the way down to the ScheduledTask.\n             val task = new ScheduledTask(TaskUtils.getTaskId(job, nextDate), nextDate, job, taskManager)\n-            return (Some(task), stream.tail())\n+            return (Some(task), stream.tail)\n           }\n-          //The nextDate has passed already beyond epsilon.\n-          //TODO(FL): Think about the semantics here and see if it always makes sense to skip ahead of missed schedules.\n+          // Next instance is too far in the future\n+          // Needs to be scheduled at a later time, after schedule horizon.\n           if (!nextDate.isBefore(now)) {","path":"src/main/scala/org/apache/mesos/chronos/scheduler/jobs/JobScheduler.scala","position":103,"original_position":103,"commit_id":"b9e9572251c8c734293a3c90392c38a443a7c160","original_commit_id":"b9e9572251c8c734293a3c90392c38a443a7c160","user":{"login":"elingg","id":8423887,"avatar_url":"https://avatars.githubusercontent.com/u/8423887?v=3","gravatar_id":"","url":"https://api.github.com/users/elingg","html_url":"https://github.com/elingg","followers_url":"https://api.github.com/users/elingg/followers","following_url":"https://api.github.com/users/elingg/following{/other_user}","gists_url":"https://api.github.com/users/elingg/gists{/gist_id}","starred_url":"https://api.github.com/users/elingg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elingg/subscriptions","organizations_url":"https://api.github.com/users/elingg/orgs","repos_url":"https://api.github.com/users/elingg/repos","events_url":"https://api.github.com/users/elingg/events{/privacy}","received_events_url":"https://api.github.com/users/elingg/received_events","type":"User","site_admin":false},"body":"Fiar enough","created_at":"2015-05-05T19:58:48Z","updated_at":"2015-05-05T19:58:48Z","html_url":"https://github.com/mesos/chronos/pull/437#discussion_r29706411","pull_request_url":"https://api.github.com/repos/mesos/chronos/pulls/437","_links":{"self":{"href":"https://api.github.com/repos/mesos/chronos/pulls/comments/29706411"},"html":{"href":"https://github.com/mesos/chronos/pull/437#discussion_r29706411"},"pull_request":{"href":"https://api.github.com/repos/mesos/chronos/pulls/437"}}},"pull_request":{"url":"https://api.github.com/repos/mesos/chronos/pulls/437","id":34414606,"html_url":"https://github.com/mesos/chronos/pull/437","diff_url":"https://github.com/mesos/chronos/pull/437.diff","patch_url":"https://github.com/mesos/chronos/pull/437.patch","issue_url":"https://api.github.com/repos/mesos/chronos/issues/437","number":437,"state":"open","locked":false,"title":"Cleanup of compiler warnings and complete JobStats refactoring","user":{"login":"azakkerman","id":3427123,"avatar_url":"https://avatars.githubusercontent.com/u/3427123?v=3","gravatar_id":"","url":"https://api.github.com/users/azakkerman","html_url":"https://github.com/azakkerman","followers_url":"https://api.github.com/users/azakkerman/followers","following_url":"https://api.github.com/users/azakkerman/following{/other_user}","gists_url":"https://api.github.com/users/azakkerman/gists{/gist_id}","starred_url":"https://api.github.com/users/azakkerman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azakkerman/subscriptions","organizations_url":"https://api.github.com/users/azakkerman/orgs","repos_url":"https://api.github.com/users/azakkerman/repos","events_url":"https://api.github.com/users/azakkerman/events{/privacy}","received_events_url":"https://api.github.com/users/azakkerman/received_events","type":"User","site_admin":false},"body":"This PR contains #436 in it. It adds proper firing of JobQueued via the new interface and adds JobExpired callback. It also makes corresponding methods in JobStats private, to make sure that they are not called from anywhere but the Observer interface.\r\n\r\nOut of boredom, I cleaned up a good number of warnings in several classes to make IntelliJ happy.","created_at":"2015-04-29T23:00:58Z","updated_at":"2015-05-05T19:58:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d11129ec248528fe4f26979fdb38fa3e0adb1d17","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mesos/chronos/pulls/437/commits","review_comments_url":"https://api.github.com/repos/mesos/chronos/pulls/437/comments","review_comment_url":"https://api.github.com/repos/mesos/chronos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesos/chronos/issues/437/comments","statuses_url":"https://api.github.com/repos/mesos/chronos/statuses/b9e9572251c8c734293a3c90392c38a443a7c160","head":{"label":"azakkerman:cleanup","ref":"cleanup","sha":"b9e9572251c8c734293a3c90392c38a443a7c160","user":{"login":"azakkerman","id":3427123,"avatar_url":"https://avatars.githubusercontent.com/u/3427123?v=3","gravatar_id":"","url":"https://api.github.com/users/azakkerman","html_url":"https://github.com/azakkerman","followers_url":"https://api.github.com/users/azakkerman/followers","following_url":"https://api.github.com/users/azakkerman/following{/other_user}","gists_url":"https://api.github.com/users/azakkerman/gists{/gist_id}","starred_url":"https://api.github.com/users/azakkerman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azakkerman/subscriptions","organizations_url":"https://api.github.com/users/azakkerman/orgs","repos_url":"https://api.github.com/users/azakkerman/repos","events_url":"https://api.github.com/users/azakkerman/events{/privacy}","received_events_url":"https://api.github.com/users/azakkerman/received_events","type":"User","site_admin":false},"repo":{"id":34689869,"name":"chronos","full_name":"azakkerman/chronos","owner":{"login":"azakkerman","id":3427123,"avatar_url":"https://avatars.githubusercontent.com/u/3427123?v=3","gravatar_id":"","url":"https://api.github.com/users/azakkerman","html_url":"https://github.com/azakkerman","followers_url":"https://api.github.com/users/azakkerman/followers","following_url":"https://api.github.com/users/azakkerman/following{/other_user}","gists_url":"https://api.github.com/users/azakkerman/gists{/gist_id}","starred_url":"https://api.github.com/users/azakkerman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azakkerman/subscriptions","organizations_url":"https://api.github.com/users/azakkerman/orgs","repos_url":"https://api.github.com/users/azakkerman/repos","events_url":"https://api.github.com/users/azakkerman/events{/privacy}","received_events_url":"https://api.github.com/users/azakkerman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/azakkerman/chronos","description":"Fault tolerant job scheduler for Mesos which handles dependencies and ISO8601 based schedules","fork":true,"url":"https://api.github.com/repos/azakkerman/chronos","forks_url":"https://api.github.com/repos/azakkerman/chronos/forks","keys_url":"https://api.github.com/repos/azakkerman/chronos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azakkerman/chronos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azakkerman/chronos/teams","hooks_url":"https://api.github.com/repos/azakkerman/chronos/hooks","issue_events_url":"https://api.github.com/repos/azakkerman/chronos/issues/events{/number}","events_url":"https://api.github.com/repos/azakkerman/chronos/events","assignees_url":"https://api.github.com/repos/azakkerman/chronos/assignees{/user}","branches_url":"https://api.github.com/repos/azakkerman/chronos/branches{/branch}","tags_url":"https://api.github.com/repos/azakkerman/chronos/tags","blobs_url":"https://api.github.com/repos/azakkerman/chronos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azakkerman/chronos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azakkerman/chronos/git/refs{/sha}","trees_url":"https://api.github.com/repos/azakkerman/chronos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azakkerman/chronos/statuses/{sha}","languages_url":"https://api.github.com/repos/azakkerman/chronos/languages","stargazers_url":"https://api.github.com/repos/azakkerman/chronos/stargazers","contributors_url":"https://api.github.com/repos/azakkerman/chronos/contributors","subscribers_url":"https://api.github.com/repos/azakkerman/chronos/subscribers","subscription_url":"https://api.github.com/repos/azakkerman/chronos/subscription","commits_url":"https://api.github.com/repos/azakkerman/chronos/commits{/sha}","git_commits_url":"https://api.github.com/repos/azakkerman/chronos/git/commits{/sha}","comments_url":"https://api.github.com/repos/azakkerman/chronos/comments{/number}","issue_comment_url":"https://api.github.com/repos/azakkerman/chronos/issues/comments{/number}","contents_url":"https://api.github.com/repos/azakkerman/chronos/contents/{+path}","compare_url":"https://api.github.com/repos/azakkerman/chronos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azakkerman/chronos/merges","archive_url":"https://api.github.com/repos/azakkerman/chronos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azakkerman/chronos/downloads","issues_url":"https://api.github.com/repos/azakkerman/chronos/issues{/number}","pulls_url":"https://api.github.com/repos/azakkerman/chronos/pulls{/number}","milestones_url":"https://api.github.com/repos/azakkerman/chronos/milestones{/number}","notifications_url":"https://api.github.com/repos/azakkerman/chronos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azakkerman/chronos/labels{/name}","releases_url":"https://api.github.com/repos/azakkerman/chronos/releases{/id}","created_at":"2015-04-27T20:35:59Z","updated_at":"2015-05-03T11:31:47Z","pushed_at":"2015-05-03T11:41:04Z","git_url":"git://github.com/azakkerman/chronos.git","ssh_url":"git@github.com:azakkerman/chronos.git","clone_url":"https://github.com/azakkerman/chronos.git","svn_url":"https://github.com/azakkerman/chronos","homepage":"","size":6546,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mesos:master","ref":"master","sha":"b5106d8cfe639ce326447e6006668b855fb1d5d3","user":{"login":"mesos","id":229272,"avatar_url":"https://avatars.githubusercontent.com/u/229272?v=3","gravatar_id":"","url":"https://api.github.com/users/mesos","html_url":"https://github.com/mesos","followers_url":"https://api.github.com/users/mesos/followers","following_url":"https://api.github.com/users/mesos/following{/other_user}","gists_url":"https://api.github.com/users/mesos/gists{/gist_id}","starred_url":"https://api.github.com/users/mesos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesos/subscriptions","organizations_url":"https://api.github.com/users/mesos/orgs","repos_url":"https://api.github.com/users/mesos/repos","events_url":"https://api.github.com/users/mesos/events{/privacy}","received_events_url":"https://api.github.com/users/mesos/received_events","type":"Organization","site_admin":false},"repo":{"id":8189762,"name":"chronos","full_name":"mesos/chronos","owner":{"login":"mesos","id":229272,"avatar_url":"https://avatars.githubusercontent.com/u/229272?v=3","gravatar_id":"","url":"https://api.github.com/users/mesos","html_url":"https://github.com/mesos","followers_url":"https://api.github.com/users/mesos/followers","following_url":"https://api.github.com/users/mesos/following{/other_user}","gists_url":"https://api.github.com/users/mesos/gists{/gist_id}","starred_url":"https://api.github.com/users/mesos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesos/subscriptions","organizations_url":"https://api.github.com/users/mesos/orgs","repos_url":"https://api.github.com/users/mesos/repos","events_url":"https://api.github.com/users/mesos/events{/privacy}","received_events_url":"https://api.github.com/users/mesos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesos/chronos","description":"Fault tolerant job scheduler for Mesos which handles dependencies and ISO8601 based schedules","fork":false,"url":"https://api.github.com/repos/mesos/chronos","forks_url":"https://api.github.com/repos/mesos/chronos/forks","keys_url":"https://api.github.com/repos/mesos/chronos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesos/chronos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesos/chronos/teams","hooks_url":"https://api.github.com/repos/mesos/chronos/hooks","issue_events_url":"https://api.github.com/repos/mesos/chronos/issues/events{/number}","events_url":"https://api.github.com/repos/mesos/chronos/events","assignees_url":"https://api.github.com/repos/mesos/chronos/assignees{/user}","branches_url":"https://api.github.com/repos/mesos/chronos/branches{/branch}","tags_url":"https://api.github.com/repos/mesos/chronos/tags","blobs_url":"https://api.github.com/repos/mesos/chronos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesos/chronos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesos/chronos/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesos/chronos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesos/chronos/statuses/{sha}","languages_url":"https://api.github.com/repos/mesos/chronos/languages","stargazers_url":"https://api.github.com/repos/mesos/chronos/stargazers","contributors_url":"https://api.github.com/repos/mesos/chronos/contributors","subscribers_url":"https://api.github.com/repos/mesos/chronos/subscribers","subscription_url":"https://api.github.com/repos/mesos/chronos/subscription","commits_url":"https://api.github.com/repos/mesos/chronos/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesos/chronos/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesos/chronos/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesos/chronos/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesos/chronos/contents/{+path}","compare_url":"https://api.github.com/repos/mesos/chronos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesos/chronos/merges","archive_url":"https://api.github.com/repos/mesos/chronos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesos/chronos/downloads","issues_url":"https://api.github.com/repos/mesos/chronos/issues{/number}","pulls_url":"https://api.github.com/repos/mesos/chronos/pulls{/number}","milestones_url":"https://api.github.com/repos/mesos/chronos/milestones{/number}","notifications_url":"https://api.github.com/repos/mesos/chronos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesos/chronos/labels{/name}","releases_url":"https://api.github.com/repos/mesos/chronos/releases{/id}","created_at":"2013-02-13T22:59:14Z","updated_at":"2015-05-05T19:18:34Z","pushed_at":"2015-05-05T19:18:34Z","git_url":"git://github.com/mesos/chronos.git","ssh_url":"git@github.com:mesos/chronos.git","clone_url":"https://github.com/mesos/chronos.git","svn_url":"https://github.com/mesos/chronos","homepage":"","size":19439,"stargazers_count":2404,"watchers_count":2404,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":263,"mirror_url":null,"open_issues_count":78,"forks":263,"open_issues":78,"watchers":2404,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesos/chronos/pulls/437"},"html":{"href":"https://github.com/mesos/chronos/pull/437"},"issue":{"href":"https://api.github.com/repos/mesos/chronos/issues/437"},"comments":{"href":"https://api.github.com/repos/mesos/chronos/issues/437/comments"},"review_comments":{"href":"https://api.github.com/repos/mesos/chronos/pulls/437/comments"},"review_comment":{"href":"https://api.github.com/repos/mesos/chronos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesos/chronos/pulls/437/commits"},"statuses":{"href":"https://api.github.com/repos/mesos/chronos/statuses/b9e9572251c8c734293a3c90392c38a443a7c160"}}}}