{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-myriad/pulls/comments/42378233","id":42378233,"diff_hunk":"@@ -211,7 +215,32 @@ private void startNMInstances(Injector injector) {\n       Map<String, Integer> nmInstances = injector.getInstance(MyriadConfiguration.class).getNmInstances();\n       MyriadOperations myriadOperations = injector.getInstance(MyriadOperations.class);\n       ServiceProfileManager profileManager = injector.getInstance(ServiceProfileManager.class);\n+      SchedulerState schedulerState = injector.getInstance(SchedulerState.class);\n+\n+      Set<NodeTask> launchedNMTasks = new HashSet<>();\n+      launchedNMTasks.addAll(\n+        schedulerState.getPendingTasksByType(NodeManagerConfiguration.NM_TASK_PREFIX));\n+      if (!launchedNMTasks.isEmpty()) {\n+        LOGGER.info(\"{} NM(s) in pending state. Not launching additional NMs\", launchedNMTasks.size());\n+        return;\n+      }\n+\n+      launchedNMTasks.addAll(\n+        schedulerState.getStagingTasksByType(NodeManagerConfiguration.NM_TASK_PREFIX));\n+      if (!launchedNMTasks.isEmpty()) {\n+        LOGGER.info(\"{} NM(s) in staging state. Not launching additional NMs\", launchedNMTasks.size());\n+        return;\n+      }\n+\n+      launchedNMTasks.addAll(\n+        schedulerState.getActiveTasksByType(NodeManagerConfiguration.NM_TASK_PREFIX));\n+      if (!launchedNMTasks.isEmpty()) {","path":"myriad-scheduler/src/main/java/com/ebay/myriad/Main.java","position":44,"original_position":44,"commit_id":"bda4cc697b6fcaa6ea156871754127d28c129437","original_commit_id":"bda4cc697b6fcaa6ea156871754127d28c129437","user":{"login":"yufeldman","id":3076038,"avatar_url":"https://avatars.githubusercontent.com/u/3076038?v=3","gravatar_id":"","url":"https://api.github.com/users/yufeldman","html_url":"https://github.com/yufeldman","followers_url":"https://api.github.com/users/yufeldman/followers","following_url":"https://api.github.com/users/yufeldman/following{/other_user}","gists_url":"https://api.github.com/users/yufeldman/gists{/gist_id}","starred_url":"https://api.github.com/users/yufeldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yufeldman/subscriptions","organizations_url":"https://api.github.com/users/yufeldman/orgs","repos_url":"https://api.github.com/users/yufeldman/repos","events_url":"https://api.github.com/users/yufeldman/events{/privacy}","received_events_url":"https://api.github.com/users/yufeldman/received_events","type":"User","site_admin":false},"body":"Same as above","created_at":"2015-10-19T14:35:33Z","updated_at":"2015-10-19T14:35:33Z","html_url":"https://github.com/apache/incubator-myriad/pull/11#discussion_r42378233","pull_request_url":"https://api.github.com/repos/apache/incubator-myriad/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-myriad/pulls/comments/42378233"},"html":{"href":"https://github.com/apache/incubator-myriad/pull/11#discussion_r42378233"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-myriad/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-myriad/pulls/11","id":48013504,"html_url":"https://github.com/apache/incubator-myriad/pull/11","diff_url":"https://github.com/apache/incubator-myriad/pull/11.diff","patch_url":"https://github.com/apache/incubator-myriad/pull/11.patch","issue_url":"https://api.github.com/repos/apache/incubator-myriad/issues/11","number":11,"state":"open","locked":false,"title":"MYRIAD-154 Restarting RM starts a \"default\" medium-profile NM on each…","user":{"login":"sdaingade","id":6597687,"avatar_url":"https://avatars.githubusercontent.com/u/6597687?v=3","gravatar_id":"","url":"https://api.github.com/users/sdaingade","html_url":"https://github.com/sdaingade","followers_url":"https://api.github.com/users/sdaingade/followers","following_url":"https://api.github.com/users/sdaingade/following{/other_user}","gists_url":"https://api.github.com/users/sdaingade/gists{/gist_id}","starred_url":"https://api.github.com/users/sdaingade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdaingade/subscriptions","organizations_url":"https://api.github.com/users/sdaingade/orgs","repos_url":"https://api.github.com/users/sdaingade/repos","events_url":"https://api.github.com/users/sdaingade/events{/privacy}","received_events_url":"https://api.github.com/users/sdaingade/received_events","type":"User","site_admin":false},"body":"… restart.\r\n\r\nWe check if there is atleast one NM in pending, staging or active state. if yes,\r\ndo not launch additional NMs.\r\n\r\nTested, NM was launched the first time as there were no NMs in pending, staging or active state.\r\nRestarted RM multiple times. No new NM was launched.","created_at":"2015-10-18T17:52:32Z","updated_at":"2015-10-19T14:35:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e7a9d3d272c0cc1c4034014688da9214cb075cd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-myriad/pulls/11/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-myriad/pulls/11/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-myriad/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-myriad/issues/11/comments","statuses_url":"https://api.github.com/repos/apache/incubator-myriad/statuses/bda4cc697b6fcaa6ea156871754127d28c129437","head":{"label":"sdaingade:master","ref":"master","sha":"bda4cc697b6fcaa6ea156871754127d28c129437","user":{"login":"sdaingade","id":6597687,"avatar_url":"https://avatars.githubusercontent.com/u/6597687?v=3","gravatar_id":"","url":"https://api.github.com/users/sdaingade","html_url":"https://github.com/sdaingade","followers_url":"https://api.github.com/users/sdaingade/followers","following_url":"https://api.github.com/users/sdaingade/following{/other_user}","gists_url":"https://api.github.com/users/sdaingade/gists{/gist_id}","starred_url":"https://api.github.com/users/sdaingade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdaingade/subscriptions","organizations_url":"https://api.github.com/users/sdaingade/orgs","repos_url":"https://api.github.com/users/sdaingade/repos","events_url":"https://api.github.com/users/sdaingade/events{/privacy}","received_events_url":"https://api.github.com/users/sdaingade/received_events","type":"User","site_admin":false},"repo":{"id":43983073,"name":"incubator-myriad","full_name":"sdaingade/incubator-myriad","owner":{"login":"sdaingade","id":6597687,"avatar_url":"https://avatars.githubusercontent.com/u/6597687?v=3","gravatar_id":"","url":"https://api.github.com/users/sdaingade","html_url":"https://github.com/sdaingade","followers_url":"https://api.github.com/users/sdaingade/followers","following_url":"https://api.github.com/users/sdaingade/following{/other_user}","gists_url":"https://api.github.com/users/sdaingade/gists{/gist_id}","starred_url":"https://api.github.com/users/sdaingade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdaingade/subscriptions","organizations_url":"https://api.github.com/users/sdaingade/orgs","repos_url":"https://api.github.com/users/sdaingade/repos","events_url":"https://api.github.com/users/sdaingade/events{/privacy}","received_events_url":"https://api.github.com/users/sdaingade/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sdaingade/incubator-myriad","description":"Mirror of Apache Myriad (Incubating)","fork":true,"url":"https://api.github.com/repos/sdaingade/incubator-myriad","forks_url":"https://api.github.com/repos/sdaingade/incubator-myriad/forks","keys_url":"https://api.github.com/repos/sdaingade/incubator-myriad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sdaingade/incubator-myriad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sdaingade/incubator-myriad/teams","hooks_url":"https://api.github.com/repos/sdaingade/incubator-myriad/hooks","issue_events_url":"https://api.github.com/repos/sdaingade/incubator-myriad/issues/events{/number}","events_url":"https://api.github.com/repos/sdaingade/incubator-myriad/events","assignees_url":"https://api.github.com/repos/sdaingade/incubator-myriad/assignees{/user}","branches_url":"https://api.github.com/repos/sdaingade/incubator-myriad/branches{/branch}","tags_url":"https://api.github.com/repos/sdaingade/incubator-myriad/tags","blobs_url":"https://api.github.com/repos/sdaingade/incubator-myriad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sdaingade/incubator-myriad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sdaingade/incubator-myriad/git/refs{/sha}","trees_url":"https://api.github.com/repos/sdaingade/incubator-myriad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sdaingade/incubator-myriad/statuses/{sha}","languages_url":"https://api.github.com/repos/sdaingade/incubator-myriad/languages","stargazers_url":"https://api.github.com/repos/sdaingade/incubator-myriad/stargazers","contributors_url":"https://api.github.com/repos/sdaingade/incubator-myriad/contributors","subscribers_url":"https://api.github.com/repos/sdaingade/incubator-myriad/subscribers","subscription_url":"https://api.github.com/repos/sdaingade/incubator-myriad/subscription","commits_url":"https://api.github.com/repos/sdaingade/incubator-myriad/commits{/sha}","git_commits_url":"https://api.github.com/repos/sdaingade/incubator-myriad/git/commits{/sha}","comments_url":"https://api.github.com/repos/sdaingade/incubator-myriad/comments{/number}","issue_comment_url":"https://api.github.com/repos/sdaingade/incubator-myriad/issues/comments{/number}","contents_url":"https://api.github.com/repos/sdaingade/incubator-myriad/contents/{+path}","compare_url":"https://api.github.com/repos/sdaingade/incubator-myriad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sdaingade/incubator-myriad/merges","archive_url":"https://api.github.com/repos/sdaingade/incubator-myriad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sdaingade/incubator-myriad/downloads","issues_url":"https://api.github.com/repos/sdaingade/incubator-myriad/issues{/number}","pulls_url":"https://api.github.com/repos/sdaingade/incubator-myriad/pulls{/number}","milestones_url":"https://api.github.com/repos/sdaingade/incubator-myriad/milestones{/number}","notifications_url":"https://api.github.com/repos/sdaingade/incubator-myriad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sdaingade/incubator-myriad/labels{/name}","releases_url":"https://api.github.com/repos/sdaingade/incubator-myriad/releases{/id}","created_at":"2015-10-09T22:27:57Z","updated_at":"2015-10-09T22:27:58Z","pushed_at":"2015-10-19T00:12:28Z","git_url":"git://github.com/sdaingade/incubator-myriad.git","ssh_url":"git@github.com:sdaingade/incubator-myriad.git","clone_url":"https://github.com/sdaingade/incubator-myriad.git","svn_url":"https://github.com/sdaingade/incubator-myriad","homepage":null,"size":4151,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"421edd230a46938331d94ffa60de1c0ec4e573ec","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":33397227,"name":"incubator-myriad","full_name":"apache/incubator-myriad","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-myriad","description":"Mirror of Apache Myriad (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-myriad","forks_url":"https://api.github.com/repos/apache/incubator-myriad/forks","keys_url":"https://api.github.com/repos/apache/incubator-myriad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-myriad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-myriad/teams","hooks_url":"https://api.github.com/repos/apache/incubator-myriad/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-myriad/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-myriad/events","assignees_url":"https://api.github.com/repos/apache/incubator-myriad/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-myriad/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-myriad/tags","blobs_url":"https://api.github.com/repos/apache/incubator-myriad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-myriad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-myriad/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-myriad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-myriad/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-myriad/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-myriad/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-myriad/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-myriad/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-myriad/subscription","commits_url":"https://api.github.com/repos/apache/incubator-myriad/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-myriad/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-myriad/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-myriad/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-myriad/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-myriad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-myriad/merges","archive_url":"https://api.github.com/repos/apache/incubator-myriad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-myriad/downloads","issues_url":"https://api.github.com/repos/apache/incubator-myriad/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-myriad/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-myriad/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-myriad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-myriad/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-myriad/releases{/id}","created_at":"2015-04-04T07:00:05Z","updated_at":"2015-10-12T15:23:27Z","pushed_at":"2015-10-18T22:12:47Z","git_url":"git://github.com/apache/incubator-myriad.git","ssh_url":"git@github.com:apache/incubator-myriad.git","clone_url":"https://github.com/apache/incubator-myriad.git","svn_url":"https://github.com/apache/incubator-myriad","homepage":null,"size":5514,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":"git://git.apache.org/incubator-myriad.git","open_issues_count":4,"forks":9,"open_issues":4,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-myriad/pulls/11"},"html":{"href":"https://github.com/apache/incubator-myriad/pull/11"},"issue":{"href":"https://api.github.com/repos/apache/incubator-myriad/issues/11"},"comments":{"href":"https://api.github.com/repos/apache/incubator-myriad/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-myriad/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-myriad/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-myriad/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-myriad/statuses/bda4cc697b6fcaa6ea156871754127d28c129437"}}}}