{"action":"created","comment":{"url":"https://api.github.com/repos/flowtick/sysiphos/pulls/comments/217292200","pull_request_review_id":154966652,"id":217292200,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzI5MjIwMA==","diff_hunk":"@@ -19,6 +20,22 @@ trait FlowExecution extends Logging {\n     flowInstanceRepository.createFlowInstance(flowSchedule.flowDefinitionId, Map.empty)\n   }\n \n+  def dueTaskRetries(now: Long): Future[Seq[FlowInstance]] = {\n+    flowTaskInstanceRepository.getScheduled().flatMap { tasks =>\n+      Future.sequence(tasks.map { task =>\n+        task.nextDueDate match {\n+          case Some(timestamp) if timestamp <= now =>\n+            log.info(s\"found ${task.id} that is due for retry\")\n+            for {\n+              instance <- flowInstanceRepository.findById(task.flowInstanceId)\n+              _ <- flowTaskInstanceRepository.setNextDueDate(task.id, None)\n+            } yield instance","path":"akka/src/main/scala/com/flowtick/sysiphos/execution/FlowExecution.scala","position":30,"original_position":30,"commit_id":"7000d0e4bcfe39627b2fc98493aeb1722aaf8abf","original_commit_id":"7000d0e4bcfe39627b2fc98493aeb1722aaf8abf","user":{"login":"glava","id":182017,"node_id":"MDQ6VXNlcjE4MjAxNw==","avatar_url":"https://avatars1.githubusercontent.com/u/182017?v=4","gravatar_id":"","url":"https://api.github.com/users/glava","html_url":"https://github.com/glava","followers_url":"https://api.github.com/users/glava/followers","following_url":"https://api.github.com/users/glava/following{/other_user}","gists_url":"https://api.github.com/users/glava/gists{/gist_id}","starred_url":"https://api.github.com/users/glava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glava/subscriptions","organizations_url":"https://api.github.com/users/glava/orgs","repos_url":"https://api.github.com/users/glava/repos","events_url":"https://api.github.com/users/glava/events{/privacy}","received_events_url":"https://api.github.com/users/glava/received_events","type":"User","site_admin":false},"body":"You mean add the retries here?","created_at":"2018-09-13T07:58:37Z","updated_at":"2018-09-13T07:58:42Z","html_url":"https://github.com/flowtick/sysiphos/pull/19#discussion_r217292200","pull_request_url":"https://api.github.com/repos/flowtick/sysiphos/pulls/19","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/flowtick/sysiphos/pulls/comments/217292200"},"html":{"href":"https://github.com/flowtick/sysiphos/pull/19#discussion_r217292200"},"pull_request":{"href":"https://api.github.com/repos/flowtick/sysiphos/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/flowtick/sysiphos/pulls/19","id":214141171,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0MTQxMTcx","html_url":"https://github.com/flowtick/sysiphos/pull/19","diff_url":"https://github.com/flowtick/sysiphos/pull/19.diff","patch_url":"https://github.com/flowtick/sysiphos/pull/19.patch","issue_url":"https://api.github.com/repos/flowtick/sysiphos/issues/19","number":19,"state":"open","locked":false,"title":"Improve retry","user":{"login":"glava","id":182017,"node_id":"MDQ6VXNlcjE4MjAxNw==","avatar_url":"https://avatars1.githubusercontent.com/u/182017?v=4","gravatar_id":"","url":"https://api.github.com/users/glava","html_url":"https://github.com/glava","followers_url":"https://api.github.com/users/glava/followers","following_url":"https://api.github.com/users/glava/following{/other_user}","gists_url":"https://api.github.com/users/glava/gists{/gist_id}","starred_url":"https://api.github.com/users/glava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glava/subscriptions","organizations_url":"https://api.github.com/users/glava/orgs","repos_url":"https://api.github.com/users/glava/repos","events_url":"https://api.github.com/users/glava/events{/privacy}","received_events_url":"https://api.github.com/users/glava/received_events","type":"User","site_admin":false},"body":"In progress. So far:\r\nExtended FlowTaskInstance with nextDueDate and retry delay field. This now allows FlowInstance to make two decisions:\r\n- in case task retries are exceeded to notify Executor that it failed as an instance\r\n- in case there are still retries to notify Executor that task should be scheduled\r\n\r\nScheduler now checks also for dueRetriedTasks. Once the task is due it voids next due date. \r\n\r\nFlowInstance is in running stage until one if its tasks exceeded the number of retries. This means FlowInstance is kept in running state while tasks are in retry state. This is because there can be some tasks that are running and can be successful, and the failed task can in next run get into successful state. \r\n","created_at":"2018-09-09T11:38:23Z","updated_at":"2018-09-13T07:58:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9631f3dc7062095bd4f0856a62da30eb28422887","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":894705757,"node_id":"MDU6TGFiZWw4OTQ3MDU3NTc=","url":"https://api.github.com/repos/flowtick/sysiphos/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/flowtick/sysiphos/pulls/19/commits","review_comments_url":"https://api.github.com/repos/flowtick/sysiphos/pulls/19/comments","review_comment_url":"https://api.github.com/repos/flowtick/sysiphos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flowtick/sysiphos/issues/19/comments","statuses_url":"https://api.github.com/repos/flowtick/sysiphos/statuses/7000d0e4bcfe39627b2fc98493aeb1722aaf8abf","head":{"label":"flowtick:improve-retry","ref":"improve-retry","sha":"7000d0e4bcfe39627b2fc98493aeb1722aaf8abf","user":{"login":"flowtick","id":29313948,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MzEzOTQ4","avatar_url":"https://avatars1.githubusercontent.com/u/29313948?v=4","gravatar_id":"","url":"https://api.github.com/users/flowtick","html_url":"https://github.com/flowtick","followers_url":"https://api.github.com/users/flowtick/followers","following_url":"https://api.github.com/users/flowtick/following{/other_user}","gists_url":"https://api.github.com/users/flowtick/gists{/gist_id}","starred_url":"https://api.github.com/users/flowtick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flowtick/subscriptions","organizations_url":"https://api.github.com/users/flowtick/orgs","repos_url":"https://api.github.com/users/flowtick/repos","events_url":"https://api.github.com/users/flowtick/events{/privacy}","received_events_url":"https://api.github.com/users/flowtick/received_events","type":"Organization","site_admin":false},"repo":{"id":110477771,"node_id":"MDEwOlJlcG9zaXRvcnkxMTA0Nzc3NzE=","name":"sysiphos","full_name":"flowtick/sysiphos","owner":{"login":"flowtick","id":29313948,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MzEzOTQ4","avatar_url":"https://avatars1.githubusercontent.com/u/29313948?v=4","gravatar_id":"","url":"https://api.github.com/users/flowtick","html_url":"https://github.com/flowtick","followers_url":"https://api.github.com/users/flowtick/followers","following_url":"https://api.github.com/users/flowtick/following{/other_user}","gists_url":"https://api.github.com/users/flowtick/gists{/gist_id}","starred_url":"https://api.github.com/users/flowtick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flowtick/subscriptions","organizations_url":"https://api.github.com/users/flowtick/orgs","repos_url":"https://api.github.com/users/flowtick/repos","events_url":"https://api.github.com/users/flowtick/events{/privacy}","received_events_url":"https://api.github.com/users/flowtick/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flowtick/sysiphos","description":"A graph-based task scheduler","fork":false,"url":"https://api.github.com/repos/flowtick/sysiphos","forks_url":"https://api.github.com/repos/flowtick/sysiphos/forks","keys_url":"https://api.github.com/repos/flowtick/sysiphos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flowtick/sysiphos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flowtick/sysiphos/teams","hooks_url":"https://api.github.com/repos/flowtick/sysiphos/hooks","issue_events_url":"https://api.github.com/repos/flowtick/sysiphos/issues/events{/number}","events_url":"https://api.github.com/repos/flowtick/sysiphos/events","assignees_url":"https://api.github.com/repos/flowtick/sysiphos/assignees{/user}","branches_url":"https://api.github.com/repos/flowtick/sysiphos/branches{/branch}","tags_url":"https://api.github.com/repos/flowtick/sysiphos/tags","blobs_url":"https://api.github.com/repos/flowtick/sysiphos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flowtick/sysiphos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flowtick/sysiphos/git/refs{/sha}","trees_url":"https://api.github.com/repos/flowtick/sysiphos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flowtick/sysiphos/statuses/{sha}","languages_url":"https://api.github.com/repos/flowtick/sysiphos/languages","stargazers_url":"https://api.github.com/repos/flowtick/sysiphos/stargazers","contributors_url":"https://api.github.com/repos/flowtick/sysiphos/contributors","subscribers_url":"https://api.github.com/repos/flowtick/sysiphos/subscribers","subscription_url":"https://api.github.com/repos/flowtick/sysiphos/subscription","commits_url":"https://api.github.com/repos/flowtick/sysiphos/commits{/sha}","git_commits_url":"https://api.github.com/repos/flowtick/sysiphos/git/commits{/sha}","comments_url":"https://api.github.com/repos/flowtick/sysiphos/comments{/number}","issue_comment_url":"https://api.github.com/repos/flowtick/sysiphos/issues/comments{/number}","contents_url":"https://api.github.com/repos/flowtick/sysiphos/contents/{+path}","compare_url":"https://api.github.com/repos/flowtick/sysiphos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flowtick/sysiphos/merges","archive_url":"https://api.github.com/repos/flowtick/sysiphos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flowtick/sysiphos/downloads","issues_url":"https://api.github.com/repos/flowtick/sysiphos/issues{/number}","pulls_url":"https://api.github.com/repos/flowtick/sysiphos/pulls{/number}","milestones_url":"https://api.github.com/repos/flowtick/sysiphos/milestones{/number}","notifications_url":"https://api.github.com/repos/flowtick/sysiphos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flowtick/sysiphos/labels{/name}","releases_url":"https://api.github.com/repos/flowtick/sysiphos/releases{/id}","deployments_url":"https://api.github.com/repos/flowtick/sysiphos/deployments","created_at":"2017-11-12T23:21:58Z","updated_at":"2018-09-07T07:51:01Z","pushed_at":"2018-09-12T22:50:06Z","git_url":"git://github.com/flowtick/sysiphos.git","ssh_url":"git@github.com:flowtick/sysiphos.git","clone_url":"https://github.com/flowtick/sysiphos.git","svn_url":"https://github.com/flowtick/sysiphos","homepage":"","size":760,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":8,"watchers":2,"default_branch":"master"}},"base":{"label":"flowtick:master","ref":"master","sha":"224b62f6bca6d8c1f6392e7360fd009a3a9f7eb5","user":{"login":"flowtick","id":29313948,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MzEzOTQ4","avatar_url":"https://avatars1.githubusercontent.com/u/29313948?v=4","gravatar_id":"","url":"https://api.github.com/users/flowtick","html_url":"https://github.com/flowtick","followers_url":"https://api.github.com/users/flowtick/followers","following_url":"https://api.github.com/users/flowtick/following{/other_user}","gists_url":"https://api.github.com/users/flowtick/gists{/gist_id}","starred_url":"https://api.github.com/users/flowtick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flowtick/subscriptions","organizations_url":"https://api.github.com/users/flowtick/orgs","repos_url":"https://api.github.com/users/flowtick/repos","events_url":"https://api.github.com/users/flowtick/events{/privacy}","received_events_url":"https://api.github.com/users/flowtick/received_events","type":"Organization","site_admin":false},"repo":{"id":110477771,"node_id":"MDEwOlJlcG9zaXRvcnkxMTA0Nzc3NzE=","name":"sysiphos","full_name":"flowtick/sysiphos","owner":{"login":"flowtick","id":29313948,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MzEzOTQ4","avatar_url":"https://avatars1.githubusercontent.com/u/29313948?v=4","gravatar_id":"","url":"https://api.github.com/users/flowtick","html_url":"https://github.com/flowtick","followers_url":"https://api.github.com/users/flowtick/followers","following_url":"https://api.github.com/users/flowtick/following{/other_user}","gists_url":"https://api.github.com/users/flowtick/gists{/gist_id}","starred_url":"https://api.github.com/users/flowtick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flowtick/subscriptions","organizations_url":"https://api.github.com/users/flowtick/orgs","repos_url":"https://api.github.com/users/flowtick/repos","events_url":"https://api.github.com/users/flowtick/events{/privacy}","received_events_url":"https://api.github.com/users/flowtick/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flowtick/sysiphos","description":"A graph-based task scheduler","fork":false,"url":"https://api.github.com/repos/flowtick/sysiphos","forks_url":"https://api.github.com/repos/flowtick/sysiphos/forks","keys_url":"https://api.github.com/repos/flowtick/sysiphos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flowtick/sysiphos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flowtick/sysiphos/teams","hooks_url":"https://api.github.com/repos/flowtick/sysiphos/hooks","issue_events_url":"https://api.github.com/repos/flowtick/sysiphos/issues/events{/number}","events_url":"https://api.github.com/repos/flowtick/sysiphos/events","assignees_url":"https://api.github.com/repos/flowtick/sysiphos/assignees{/user}","branches_url":"https://api.github.com/repos/flowtick/sysiphos/branches{/branch}","tags_url":"https://api.github.com/repos/flowtick/sysiphos/tags","blobs_url":"https://api.github.com/repos/flowtick/sysiphos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flowtick/sysiphos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flowtick/sysiphos/git/refs{/sha}","trees_url":"https://api.github.com/repos/flowtick/sysiphos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flowtick/sysiphos/statuses/{sha}","languages_url":"https://api.github.com/repos/flowtick/sysiphos/languages","stargazers_url":"https://api.github.com/repos/flowtick/sysiphos/stargazers","contributors_url":"https://api.github.com/repos/flowtick/sysiphos/contributors","subscribers_url":"https://api.github.com/repos/flowtick/sysiphos/subscribers","subscription_url":"https://api.github.com/repos/flowtick/sysiphos/subscription","commits_url":"https://api.github.com/repos/flowtick/sysiphos/commits{/sha}","git_commits_url":"https://api.github.com/repos/flowtick/sysiphos/git/commits{/sha}","comments_url":"https://api.github.com/repos/flowtick/sysiphos/comments{/number}","issue_comment_url":"https://api.github.com/repos/flowtick/sysiphos/issues/comments{/number}","contents_url":"https://api.github.com/repos/flowtick/sysiphos/contents/{+path}","compare_url":"https://api.github.com/repos/flowtick/sysiphos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flowtick/sysiphos/merges","archive_url":"https://api.github.com/repos/flowtick/sysiphos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flowtick/sysiphos/downloads","issues_url":"https://api.github.com/repos/flowtick/sysiphos/issues{/number}","pulls_url":"https://api.github.com/repos/flowtick/sysiphos/pulls{/number}","milestones_url":"https://api.github.com/repos/flowtick/sysiphos/milestones{/number}","notifications_url":"https://api.github.com/repos/flowtick/sysiphos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flowtick/sysiphos/labels{/name}","releases_url":"https://api.github.com/repos/flowtick/sysiphos/releases{/id}","deployments_url":"https://api.github.com/repos/flowtick/sysiphos/deployments","created_at":"2017-11-12T23:21:58Z","updated_at":"2018-09-07T07:51:01Z","pushed_at":"2018-09-12T22:50:06Z","git_url":"git://github.com/flowtick/sysiphos.git","ssh_url":"git@github.com:flowtick/sysiphos.git","clone_url":"https://github.com/flowtick/sysiphos.git","svn_url":"https://github.com/flowtick/sysiphos","homepage":"","size":760,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":8,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flowtick/sysiphos/pulls/19"},"html":{"href":"https://github.com/flowtick/sysiphos/pull/19"},"issue":{"href":"https://api.github.com/repos/flowtick/sysiphos/issues/19"},"comments":{"href":"https://api.github.com/repos/flowtick/sysiphos/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/flowtick/sysiphos/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/flowtick/sysiphos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flowtick/sysiphos/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/flowtick/sysiphos/statuses/7000d0e4bcfe39627b2fc98493aeb1722aaf8abf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"glava"}}