{"action":"created","comment":{"url":"https://api.github.com/repos/azkaban/azkaban/pulls/comments/40265808","id":40265808,"diff_hunk":"@@ -1811,9 +1831,32 @@ private void processQueuedFlows(long activeExecutorsRefreshWindow,\n           currentContinuousFlowProcessed = 0;\n         }\n \n-        exflow.setUpdateTime(currentTime);\n-        // process flow with current snapshot of activeExecutors\n-        processFlow(reference, exflow, new HashSet<Executor>(activeExecutors));\n+        /**\n+         * <pre>\n+         *  TODO: Work around till we improve Filters to have a notion of GlobalSystemState.\n+         *        Currently we try each queued flow once to infer a global busy state\n+         * Possible improvements:-\n+         *   1. Move system level filters in refreshExecutors and sleep if we have all executors busy after refresh\n+         *   2. Implement GlobalSystemState in selector or in a third place to manage system filters. Basically\n+         *      taking out all the filters which do not depend on the flow but are still being part of Selector.\n+         * Assumptions:-\n+         *   1. no one else except QueueProcessor is updating ExecutableFlow update time\n+         *   2. re-attempting a flow (which has been tried before) is considered as all executors are busy\n+         * </pre>\n+         */\n+        if(exflow.getUpdateTime() > lastExecutorRefreshTime) {\n+          // put back in the queue\n+          queuedFlows.enqueue(exflow, reference);\n+          long sleepInterval =\n+            activeExecutorsRefreshWindow\n+              - (currentTime - lastExecutorRefreshTime);\n+          // wait till next executor refresh\n+          sleep(sleepInterval);\n+        } else {\n+          exflow.setUpdateTime(currentTime);\n+          // process flow with current snapshot of activeExecutors\n+          processFlow(reference, exflow, new HashSet<Executor>(activeExecutors));","path":"azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java","position":127,"original_position":127,"commit_id":"3f79b150c6aba17a7171d19cafc322369f0c9a59","original_commit_id":"3f79b150c6aba17a7171d19cafc322369f0c9a59","user":{"login":"johnyu0520","id":12088335,"avatar_url":"https://avatars.githubusercontent.com/u/12088335?v=3","gravatar_id":"","url":"https://api.github.com/users/johnyu0520","html_url":"https://github.com/johnyu0520","followers_url":"https://api.github.com/users/johnyu0520/followers","following_url":"https://api.github.com/users/johnyu0520/following{/other_user}","gists_url":"https://api.github.com/users/johnyu0520/gists{/gist_id}","starred_url":"https://api.github.com/users/johnyu0520/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnyu0520/subscriptions","organizations_url":"https://api.github.com/users/johnyu0520/orgs","repos_url":"https://api.github.com/users/johnyu0520/repos","events_url":"https://api.github.com/users/johnyu0520/events{/privacy}","received_events_url":"https://api.github.com/users/johnyu0520/received_events","type":"User","site_admin":false},"body":"nit-picking on names again :)\r\nCan we name it something along the lines of SelectAndDispatchFlow? and also spell it out in the javadoc for it?\r\n\"process\" can potentially mean lots of different things even within the ExecutorManager.java context\r\n","created_at":"2015-09-23T22:24:08Z","updated_at":"2015-09-23T22:24:08Z","html_url":"https://github.com/azkaban/azkaban/pull/500#discussion_r40265808","pull_request_url":"https://api.github.com/repos/azkaban/azkaban/pulls/500","_links":{"self":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/comments/40265808"},"html":{"href":"https://github.com/azkaban/azkaban/pull/500#discussion_r40265808"},"pull_request":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/500"}}},"pull_request":{"url":"https://api.github.com/repos/azkaban/azkaban/pulls/500","id":45718766,"html_url":"https://github.com/azkaban/azkaban/pull/500","diff_url":"https://github.com/azkaban/azkaban/pull/500.diff","patch_url":"https://github.com/azkaban/azkaban/pull/500.patch","issue_url":"https://api.github.com/repos/azkaban/azkaban/issues/500","number":500,"state":"open","locked":false,"title":"Fixing single executor to multi-executor transition and work around work around for global busy state","user":{"login":"logiclord","id":770329,"avatar_url":"https://avatars.githubusercontent.com/u/770329?v=3","gravatar_id":"","url":"https://api.github.com/users/logiclord","html_url":"https://github.com/logiclord","followers_url":"https://api.github.com/users/logiclord/followers","following_url":"https://api.github.com/users/logiclord/following{/other_user}","gists_url":"https://api.github.com/users/logiclord/gists{/gist_id}","starred_url":"https://api.github.com/users/logiclord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logiclord/subscriptions","organizations_url":"https://api.github.com/users/logiclord/orgs","repos_url":"https://api.github.com/users/logiclord/repos","events_url":"https://api.github.com/users/logiclord/events{/privacy}","received_events_url":"https://api.github.com/users/logiclord/received_events","type":"User","site_admin":false},"body":"* Fixing single executor to multi-executor transition\r\n* Work around work around for global busy state\r\n* Fixing cold start to refreshExecutors first time we start processing the queue.","created_at":"2015-09-22T21:23:26Z","updated_at":"2015-09-23T22:24:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8cab35b2eccf336f78f1583b769165aa299ad45a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/azkaban/azkaban/pulls/500/commits","review_comments_url":"https://api.github.com/repos/azkaban/azkaban/pulls/500/comments","review_comment_url":"https://api.github.com/repos/azkaban/azkaban/pulls/comments{/number}","comments_url":"https://api.github.com/repos/azkaban/azkaban/issues/500/comments","statuses_url":"https://api.github.com/repos/azkaban/azkaban/statuses/3f79b150c6aba17a7171d19cafc322369f0c9a59","head":{"label":"logiclord:multipleexecutors","ref":"multipleexecutors","sha":"3f79b150c6aba17a7171d19cafc322369f0c9a59","user":{"login":"logiclord","id":770329,"avatar_url":"https://avatars.githubusercontent.com/u/770329?v=3","gravatar_id":"","url":"https://api.github.com/users/logiclord","html_url":"https://github.com/logiclord","followers_url":"https://api.github.com/users/logiclord/followers","following_url":"https://api.github.com/users/logiclord/following{/other_user}","gists_url":"https://api.github.com/users/logiclord/gists{/gist_id}","starred_url":"https://api.github.com/users/logiclord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logiclord/subscriptions","organizations_url":"https://api.github.com/users/logiclord/orgs","repos_url":"https://api.github.com/users/logiclord/repos","events_url":"https://api.github.com/users/logiclord/events{/privacy}","received_events_url":"https://api.github.com/users/logiclord/received_events","type":"User","site_admin":false},"repo":{"id":26245135,"name":"azkaban","full_name":"logiclord/azkaban","owner":{"login":"logiclord","id":770329,"avatar_url":"https://avatars.githubusercontent.com/u/770329?v=3","gravatar_id":"","url":"https://api.github.com/users/logiclord","html_url":"https://github.com/logiclord","followers_url":"https://api.github.com/users/logiclord/followers","following_url":"https://api.github.com/users/logiclord/following{/other_user}","gists_url":"https://api.github.com/users/logiclord/gists{/gist_id}","starred_url":"https://api.github.com/users/logiclord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logiclord/subscriptions","organizations_url":"https://api.github.com/users/logiclord/orgs","repos_url":"https://api.github.com/users/logiclord/repos","events_url":"https://api.github.com/users/logiclord/events{/privacy}","received_events_url":"https://api.github.com/users/logiclord/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/logiclord/azkaban","description":"Azkaban workflow manager.","fork":true,"url":"https://api.github.com/repos/logiclord/azkaban","forks_url":"https://api.github.com/repos/logiclord/azkaban/forks","keys_url":"https://api.github.com/repos/logiclord/azkaban/keys{/key_id}","collaborators_url":"https://api.github.com/repos/logiclord/azkaban/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/logiclord/azkaban/teams","hooks_url":"https://api.github.com/repos/logiclord/azkaban/hooks","issue_events_url":"https://api.github.com/repos/logiclord/azkaban/issues/events{/number}","events_url":"https://api.github.com/repos/logiclord/azkaban/events","assignees_url":"https://api.github.com/repos/logiclord/azkaban/assignees{/user}","branches_url":"https://api.github.com/repos/logiclord/azkaban/branches{/branch}","tags_url":"https://api.github.com/repos/logiclord/azkaban/tags","blobs_url":"https://api.github.com/repos/logiclord/azkaban/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/logiclord/azkaban/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/logiclord/azkaban/git/refs{/sha}","trees_url":"https://api.github.com/repos/logiclord/azkaban/git/trees{/sha}","statuses_url":"https://api.github.com/repos/logiclord/azkaban/statuses/{sha}","languages_url":"https://api.github.com/repos/logiclord/azkaban/languages","stargazers_url":"https://api.github.com/repos/logiclord/azkaban/stargazers","contributors_url":"https://api.github.com/repos/logiclord/azkaban/contributors","subscribers_url":"https://api.github.com/repos/logiclord/azkaban/subscribers","subscription_url":"https://api.github.com/repos/logiclord/azkaban/subscription","commits_url":"https://api.github.com/repos/logiclord/azkaban/commits{/sha}","git_commits_url":"https://api.github.com/repos/logiclord/azkaban/git/commits{/sha}","comments_url":"https://api.github.com/repos/logiclord/azkaban/comments{/number}","issue_comment_url":"https://api.github.com/repos/logiclord/azkaban/issues/comments{/number}","contents_url":"https://api.github.com/repos/logiclord/azkaban/contents/{+path}","compare_url":"https://api.github.com/repos/logiclord/azkaban/compare/{base}...{head}","merges_url":"https://api.github.com/repos/logiclord/azkaban/merges","archive_url":"https://api.github.com/repos/logiclord/azkaban/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/logiclord/azkaban/downloads","issues_url":"https://api.github.com/repos/logiclord/azkaban/issues{/number}","pulls_url":"https://api.github.com/repos/logiclord/azkaban/pulls{/number}","milestones_url":"https://api.github.com/repos/logiclord/azkaban/milestones{/number}","notifications_url":"https://api.github.com/repos/logiclord/azkaban/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/logiclord/azkaban/labels{/name}","releases_url":"https://api.github.com/repos/logiclord/azkaban/releases{/id}","created_at":"2014-11-05T23:44:11Z","updated_at":"2015-02-11T21:42:12Z","pushed_at":"2015-09-23T19:52:04Z","git_url":"git://github.com/logiclord/azkaban.git","ssh_url":"git@github.com:logiclord/azkaban.git","clone_url":"https://github.com/logiclord/azkaban.git","svn_url":"https://github.com/logiclord/azkaban","homepage":"https://azkaban.github.io","size":33206,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"azkaban:multipleexecutors","ref":"multipleexecutors","sha":"027bc198fe11cc9872c2a9402770e9bdc2ea6479","user":{"login":"azkaban","id":213618,"avatar_url":"https://avatars.githubusercontent.com/u/213618?v=3","gravatar_id":"","url":"https://api.github.com/users/azkaban","html_url":"https://github.com/azkaban","followers_url":"https://api.github.com/users/azkaban/followers","following_url":"https://api.github.com/users/azkaban/following{/other_user}","gists_url":"https://api.github.com/users/azkaban/gists{/gist_id}","starred_url":"https://api.github.com/users/azkaban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azkaban/subscriptions","organizations_url":"https://api.github.com/users/azkaban/orgs","repos_url":"https://api.github.com/users/azkaban/repos","events_url":"https://api.github.com/users/azkaban/events{/privacy}","received_events_url":"https://api.github.com/users/azkaban/received_events","type":"Organization","site_admin":false},"repo":{"id":6271421,"name":"azkaban","full_name":"azkaban/azkaban","owner":{"login":"azkaban","id":213618,"avatar_url":"https://avatars.githubusercontent.com/u/213618?v=3","gravatar_id":"","url":"https://api.github.com/users/azkaban","html_url":"https://github.com/azkaban","followers_url":"https://api.github.com/users/azkaban/followers","following_url":"https://api.github.com/users/azkaban/following{/other_user}","gists_url":"https://api.github.com/users/azkaban/gists{/gist_id}","starred_url":"https://api.github.com/users/azkaban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azkaban/subscriptions","organizations_url":"https://api.github.com/users/azkaban/orgs","repos_url":"https://api.github.com/users/azkaban/repos","events_url":"https://api.github.com/users/azkaban/events{/privacy}","received_events_url":"https://api.github.com/users/azkaban/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/azkaban/azkaban","description":"Azkaban workflow manager.","fork":false,"url":"https://api.github.com/repos/azkaban/azkaban","forks_url":"https://api.github.com/repos/azkaban/azkaban/forks","keys_url":"https://api.github.com/repos/azkaban/azkaban/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azkaban/azkaban/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azkaban/azkaban/teams","hooks_url":"https://api.github.com/repos/azkaban/azkaban/hooks","issue_events_url":"https://api.github.com/repos/azkaban/azkaban/issues/events{/number}","events_url":"https://api.github.com/repos/azkaban/azkaban/events","assignees_url":"https://api.github.com/repos/azkaban/azkaban/assignees{/user}","branches_url":"https://api.github.com/repos/azkaban/azkaban/branches{/branch}","tags_url":"https://api.github.com/repos/azkaban/azkaban/tags","blobs_url":"https://api.github.com/repos/azkaban/azkaban/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azkaban/azkaban/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azkaban/azkaban/git/refs{/sha}","trees_url":"https://api.github.com/repos/azkaban/azkaban/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azkaban/azkaban/statuses/{sha}","languages_url":"https://api.github.com/repos/azkaban/azkaban/languages","stargazers_url":"https://api.github.com/repos/azkaban/azkaban/stargazers","contributors_url":"https://api.github.com/repos/azkaban/azkaban/contributors","subscribers_url":"https://api.github.com/repos/azkaban/azkaban/subscribers","subscription_url":"https://api.github.com/repos/azkaban/azkaban/subscription","commits_url":"https://api.github.com/repos/azkaban/azkaban/commits{/sha}","git_commits_url":"https://api.github.com/repos/azkaban/azkaban/git/commits{/sha}","comments_url":"https://api.github.com/repos/azkaban/azkaban/comments{/number}","issue_comment_url":"https://api.github.com/repos/azkaban/azkaban/issues/comments{/number}","contents_url":"https://api.github.com/repos/azkaban/azkaban/contents/{+path}","compare_url":"https://api.github.com/repos/azkaban/azkaban/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azkaban/azkaban/merges","archive_url":"https://api.github.com/repos/azkaban/azkaban/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azkaban/azkaban/downloads","issues_url":"https://api.github.com/repos/azkaban/azkaban/issues{/number}","pulls_url":"https://api.github.com/repos/azkaban/azkaban/pulls{/number}","milestones_url":"https://api.github.com/repos/azkaban/azkaban/milestones{/number}","notifications_url":"https://api.github.com/repos/azkaban/azkaban/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azkaban/azkaban/labels{/name}","releases_url":"https://api.github.com/repos/azkaban/azkaban/releases{/id}","created_at":"2012-10-18T01:34:53Z","updated_at":"2015-09-23T05:31:13Z","pushed_at":"2015-09-23T22:04:52Z","git_url":"git://github.com/azkaban/azkaban.git","ssh_url":"git@github.com:azkaban/azkaban.git","clone_url":"https://github.com/azkaban/azkaban.git","svn_url":"https://github.com/azkaban/azkaban","homepage":"https://azkaban.github.io","size":36696,"stargazers_count":422,"watchers_count":422,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":238,"mirror_url":null,"open_issues_count":140,"forks":238,"open_issues":140,"watchers":422,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/500"},"html":{"href":"https://github.com/azkaban/azkaban/pull/500"},"issue":{"href":"https://api.github.com/repos/azkaban/azkaban/issues/500"},"comments":{"href":"https://api.github.com/repos/azkaban/azkaban/issues/500/comments"},"review_comments":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/500/comments"},"review_comment":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/500/commits"},"statuses":{"href":"https://api.github.com/repos/azkaban/azkaban/statuses/3f79b150c6aba17a7171d19cafc322369f0c9a59"}}}}