{"action":"created","comment":{"url":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/comments/167788643","pull_request_review_id":96055610,"id":167788643,"diff_hunk":"@@ -432,6 +435,63 @@ public static void main(String[] args) {\n         }\n     }\n \n+    private static BlockingQueue<KeyPair> keyPairs = new LinkedBlockingQueue<>();\n+\n+    private static void launchBackgorundKeyPairMaker(final int numberOfWorkers) {\n+        final Thread thread = new Thread(new Runnable() {\n+            @Override\n+            public void run() {\n+                while (!Thread.interrupted()) {\n+                    try {\n+                        // if we obeserve less than 'numberOfWorkers' elements than we goint to\n+                        // add 'numberOfWorkers' more\n+                        if (keyPairs.size() < numberOfWorkers) {\n+                            RMNodeStarter.generateAndAddKeyPairs(numberOfWorkers);\n+                        }\n+\n+                        // sleep 1 second, ot until notification (from getKeyPair method)\n+                        synchronized (keyPairs) {\n+                            keyPairs.wait(1000);\n+                        }\n+                    } catch (InterruptedException | NoSuchAlgorithmException e) {\n+                        logger.warn(\"Something went terribly wrong.\", e);\n+                        Thread.currentThread().interrupt();","path":"rm/rm-node/src/main/java/org/ow2/proactive/resourcemanager/utils/RMNodeStarter.java","position":51,"original_position":51,"commit_id":"4b2ac99348520c4ad2f928e7a3ca91ce98e5d57d","original_commit_id":"4b2ac99348520c4ad2f928e7a3ca91ce98e5d57d","user":{"login":"jrochas","id":10711209,"avatar_url":"https://avatars3.githubusercontent.com/u/10711209?v=4","gravatar_id":"","url":"https://api.github.com/users/jrochas","html_url":"https://github.com/jrochas","followers_url":"https://api.github.com/users/jrochas/followers","following_url":"https://api.github.com/users/jrochas/following{/other_user}","gists_url":"https://api.github.com/users/jrochas/gists{/gist_id}","starred_url":"https://api.github.com/users/jrochas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrochas/subscriptions","organizations_url":"https://api.github.com/users/jrochas/orgs","repos_url":"https://api.github.com/users/jrochas/repos","events_url":"https://api.github.com/users/jrochas/events{/privacy}","received_events_url":"https://api.github.com/users/jrochas/received_events","type":"User","site_admin":false},"body":"If the thread is interrupted or dies somehow we need to make sure that we are still able to produce key pairs otherwise no task will ever be launched further.\r\n\r\nMaybe restart a background maker in all cases or fall back to a foreground (like before).","created_at":"2018-02-13T08:26:16Z","updated_at":"2018-02-13T08:26:16Z","html_url":"https://github.com/ow2-proactive/scheduling/pull/3132#discussion_r167788643","pull_request_url":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/3132","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/comments/167788643"},"html":{"href":"https://github.com/ow2-proactive/scheduling/pull/3132#discussion_r167788643"},"pull_request":{"href":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/3132"}}},"pull_request":{"url":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/3132","id":168596753,"html_url":"https://github.com/ow2-proactive/scheduling/pull/3132","diff_url":"https://github.com/ow2-proactive/scheduling/pull/3132.diff","patch_url":"https://github.com/ow2-proactive/scheduling/pull/3132.patch","issue_url":"https://api.github.com/repos/ow2-proactive/scheduling/issues/3132","number":3132,"state":"open","locked":false,"title":"Add queue of pre-created key pairs to RMNodeStarter","user":{"login":"Mykhailenko","id":761558,"avatar_url":"https://avatars3.githubusercontent.com/u/761558?v=4","gravatar_id":"","url":"https://api.github.com/users/Mykhailenko","html_url":"https://github.com/Mykhailenko","followers_url":"https://api.github.com/users/Mykhailenko/followers","following_url":"https://api.github.com/users/Mykhailenko/following{/other_user}","gists_url":"https://api.github.com/users/Mykhailenko/gists{/gist_id}","starred_url":"https://api.github.com/users/Mykhailenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mykhailenko/subscriptions","organizations_url":"https://api.github.com/users/Mykhailenko/orgs","repos_url":"https://api.github.com/users/Mykhailenko/repos","events_url":"https://api.github.com/users/Mykhailenko/events{/privacy}","received_events_url":"https://api.github.com/users/Mykhailenko/received_events","type":"User","site_admin":false},"body":"TaskLauncher generates KeyPair every time we dispatch a task. So the idea is to have thread in background which will pre-create key pairs and store them in the queue.","created_at":"2018-02-12T14:44:38Z","updated_at":"2018-02-13T08:26:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d68a609b5daaf0546c518af0aac9a6968a704954","assignee":null,"assignees":[],"requested_reviewers":[{"login":"fviale","id":3063713,"avatar_url":"https://avatars0.githubusercontent.com/u/3063713?v=4","gravatar_id":"","url":"https://api.github.com/users/fviale","html_url":"https://github.com/fviale","followers_url":"https://api.github.com/users/fviale/followers","following_url":"https://api.github.com/users/fviale/following{/other_user}","gists_url":"https://api.github.com/users/fviale/gists{/gist_id}","starred_url":"https://api.github.com/users/fviale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fviale/subscriptions","organizations_url":"https://api.github.com/users/fviale/orgs","repos_url":"https://api.github.com/users/fviale/repos","events_url":"https://api.github.com/users/fviale/events{/privacy}","received_events_url":"https://api.github.com/users/fviale/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/3132/commits","review_comments_url":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/3132/comments","review_comment_url":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ow2-proactive/scheduling/issues/3132/comments","statuses_url":"https://api.github.com/repos/ow2-proactive/scheduling/statuses/4b2ac99348520c4ad2f928e7a3ca91ce98e5d57d","head":{"label":"Mykhailenko:add-queue-pre-ssh","ref":"add-queue-pre-ssh","sha":"4b2ac99348520c4ad2f928e7a3ca91ce98e5d57d","user":{"login":"Mykhailenko","id":761558,"avatar_url":"https://avatars3.githubusercontent.com/u/761558?v=4","gravatar_id":"","url":"https://api.github.com/users/Mykhailenko","html_url":"https://github.com/Mykhailenko","followers_url":"https://api.github.com/users/Mykhailenko/followers","following_url":"https://api.github.com/users/Mykhailenko/following{/other_user}","gists_url":"https://api.github.com/users/Mykhailenko/gists{/gist_id}","starred_url":"https://api.github.com/users/Mykhailenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mykhailenko/subscriptions","organizations_url":"https://api.github.com/users/Mykhailenko/orgs","repos_url":"https://api.github.com/users/Mykhailenko/repos","events_url":"https://api.github.com/users/Mykhailenko/events{/privacy}","received_events_url":"https://api.github.com/users/Mykhailenko/received_events","type":"User","site_admin":false},"repo":{"id":107121787,"name":"scheduling","full_name":"Mykhailenko/scheduling","owner":{"login":"Mykhailenko","id":761558,"avatar_url":"https://avatars3.githubusercontent.com/u/761558?v=4","gravatar_id":"","url":"https://api.github.com/users/Mykhailenko","html_url":"https://github.com/Mykhailenko","followers_url":"https://api.github.com/users/Mykhailenko/followers","following_url":"https://api.github.com/users/Mykhailenko/following{/other_user}","gists_url":"https://api.github.com/users/Mykhailenko/gists{/gist_id}","starred_url":"https://api.github.com/users/Mykhailenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mykhailenko/subscriptions","organizations_url":"https://api.github.com/users/Mykhailenko/orgs","repos_url":"https://api.github.com/users/Mykhailenko/repos","events_url":"https://api.github.com/users/Mykhailenko/events{/privacy}","received_events_url":"https://api.github.com/users/Mykhailenko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mykhailenko/scheduling","description":"Multi-platform Scheduling and Workflows Engine","fork":true,"url":"https://api.github.com/repos/Mykhailenko/scheduling","forks_url":"https://api.github.com/repos/Mykhailenko/scheduling/forks","keys_url":"https://api.github.com/repos/Mykhailenko/scheduling/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mykhailenko/scheduling/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mykhailenko/scheduling/teams","hooks_url":"https://api.github.com/repos/Mykhailenko/scheduling/hooks","issue_events_url":"https://api.github.com/repos/Mykhailenko/scheduling/issues/events{/number}","events_url":"https://api.github.com/repos/Mykhailenko/scheduling/events","assignees_url":"https://api.github.com/repos/Mykhailenko/scheduling/assignees{/user}","branches_url":"https://api.github.com/repos/Mykhailenko/scheduling/branches{/branch}","tags_url":"https://api.github.com/repos/Mykhailenko/scheduling/tags","blobs_url":"https://api.github.com/repos/Mykhailenko/scheduling/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mykhailenko/scheduling/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mykhailenko/scheduling/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mykhailenko/scheduling/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mykhailenko/scheduling/statuses/{sha}","languages_url":"https://api.github.com/repos/Mykhailenko/scheduling/languages","stargazers_url":"https://api.github.com/repos/Mykhailenko/scheduling/stargazers","contributors_url":"https://api.github.com/repos/Mykhailenko/scheduling/contributors","subscribers_url":"https://api.github.com/repos/Mykhailenko/scheduling/subscribers","subscription_url":"https://api.github.com/repos/Mykhailenko/scheduling/subscription","commits_url":"https://api.github.com/repos/Mykhailenko/scheduling/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mykhailenko/scheduling/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mykhailenko/scheduling/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mykhailenko/scheduling/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mykhailenko/scheduling/contents/{+path}","compare_url":"https://api.github.com/repos/Mykhailenko/scheduling/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mykhailenko/scheduling/merges","archive_url":"https://api.github.com/repos/Mykhailenko/scheduling/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mykhailenko/scheduling/downloads","issues_url":"https://api.github.com/repos/Mykhailenko/scheduling/issues{/number}","pulls_url":"https://api.github.com/repos/Mykhailenko/scheduling/pulls{/number}","milestones_url":"https://api.github.com/repos/Mykhailenko/scheduling/milestones{/number}","notifications_url":"https://api.github.com/repos/Mykhailenko/scheduling/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mykhailenko/scheduling/labels{/name}","releases_url":"https://api.github.com/repos/Mykhailenko/scheduling/releases{/id}","deployments_url":"https://api.github.com/repos/Mykhailenko/scheduling/deployments","created_at":"2017-10-16T12:04:11Z","updated_at":"2017-10-16T12:04:19Z","pushed_at":"2018-02-13T07:37:18Z","git_url":"git://github.com/Mykhailenko/scheduling.git","ssh_url":"git@github.com:Mykhailenko/scheduling.git","clone_url":"https://github.com/Mykhailenko/scheduling.git","svn_url":"https://github.com/Mykhailenko/scheduling","homepage":"http://www.activeeon.com/workflows-scheduling","size":72349,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ow2-proactive:master","ref":"master","sha":"2ea3abb6f7967cf215eeb430ffa159bd93219caf","user":{"login":"ow2-proactive","id":11553998,"avatar_url":"https://avatars1.githubusercontent.com/u/11553998?v=4","gravatar_id":"","url":"https://api.github.com/users/ow2-proactive","html_url":"https://github.com/ow2-proactive","followers_url":"https://api.github.com/users/ow2-proactive/followers","following_url":"https://api.github.com/users/ow2-proactive/following{/other_user}","gists_url":"https://api.github.com/users/ow2-proactive/gists{/gist_id}","starred_url":"https://api.github.com/users/ow2-proactive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ow2-proactive/subscriptions","organizations_url":"https://api.github.com/users/ow2-proactive/orgs","repos_url":"https://api.github.com/users/ow2-proactive/repos","events_url":"https://api.github.com/users/ow2-proactive/events{/privacy}","received_events_url":"https://api.github.com/users/ow2-proactive/received_events","type":"Organization","site_admin":false},"repo":{"id":35725079,"name":"scheduling","full_name":"ow2-proactive/scheduling","owner":{"login":"ow2-proactive","id":11553998,"avatar_url":"https://avatars1.githubusercontent.com/u/11553998?v=4","gravatar_id":"","url":"https://api.github.com/users/ow2-proactive","html_url":"https://github.com/ow2-proactive","followers_url":"https://api.github.com/users/ow2-proactive/followers","following_url":"https://api.github.com/users/ow2-proactive/following{/other_user}","gists_url":"https://api.github.com/users/ow2-proactive/gists{/gist_id}","starred_url":"https://api.github.com/users/ow2-proactive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ow2-proactive/subscriptions","organizations_url":"https://api.github.com/users/ow2-proactive/orgs","repos_url":"https://api.github.com/users/ow2-proactive/repos","events_url":"https://api.github.com/users/ow2-proactive/events{/privacy}","received_events_url":"https://api.github.com/users/ow2-proactive/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ow2-proactive/scheduling","description":"Multi-platform Scheduling and Workflows Engine","fork":false,"url":"https://api.github.com/repos/ow2-proactive/scheduling","forks_url":"https://api.github.com/repos/ow2-proactive/scheduling/forks","keys_url":"https://api.github.com/repos/ow2-proactive/scheduling/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ow2-proactive/scheduling/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ow2-proactive/scheduling/teams","hooks_url":"https://api.github.com/repos/ow2-proactive/scheduling/hooks","issue_events_url":"https://api.github.com/repos/ow2-proactive/scheduling/issues/events{/number}","events_url":"https://api.github.com/repos/ow2-proactive/scheduling/events","assignees_url":"https://api.github.com/repos/ow2-proactive/scheduling/assignees{/user}","branches_url":"https://api.github.com/repos/ow2-proactive/scheduling/branches{/branch}","tags_url":"https://api.github.com/repos/ow2-proactive/scheduling/tags","blobs_url":"https://api.github.com/repos/ow2-proactive/scheduling/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ow2-proactive/scheduling/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ow2-proactive/scheduling/git/refs{/sha}","trees_url":"https://api.github.com/repos/ow2-proactive/scheduling/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ow2-proactive/scheduling/statuses/{sha}","languages_url":"https://api.github.com/repos/ow2-proactive/scheduling/languages","stargazers_url":"https://api.github.com/repos/ow2-proactive/scheduling/stargazers","contributors_url":"https://api.github.com/repos/ow2-proactive/scheduling/contributors","subscribers_url":"https://api.github.com/repos/ow2-proactive/scheduling/subscribers","subscription_url":"https://api.github.com/repos/ow2-proactive/scheduling/subscription","commits_url":"https://api.github.com/repos/ow2-proactive/scheduling/commits{/sha}","git_commits_url":"https://api.github.com/repos/ow2-proactive/scheduling/git/commits{/sha}","comments_url":"https://api.github.com/repos/ow2-proactive/scheduling/comments{/number}","issue_comment_url":"https://api.github.com/repos/ow2-proactive/scheduling/issues/comments{/number}","contents_url":"https://api.github.com/repos/ow2-proactive/scheduling/contents/{+path}","compare_url":"https://api.github.com/repos/ow2-proactive/scheduling/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ow2-proactive/scheduling/merges","archive_url":"https://api.github.com/repos/ow2-proactive/scheduling/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ow2-proactive/scheduling/downloads","issues_url":"https://api.github.com/repos/ow2-proactive/scheduling/issues{/number}","pulls_url":"https://api.github.com/repos/ow2-proactive/scheduling/pulls{/number}","milestones_url":"https://api.github.com/repos/ow2-proactive/scheduling/milestones{/number}","notifications_url":"https://api.github.com/repos/ow2-proactive/scheduling/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ow2-proactive/scheduling/labels{/name}","releases_url":"https://api.github.com/repos/ow2-proactive/scheduling/releases{/id}","deployments_url":"https://api.github.com/repos/ow2-proactive/scheduling/deployments","created_at":"2015-05-16T13:38:55Z","updated_at":"2018-01-12T14:23:37Z","pushed_at":"2018-02-13T07:37:19Z","git_url":"git://github.com/ow2-proactive/scheduling.git","ssh_url":"git@github.com:ow2-proactive/scheduling.git","clone_url":"https://github.com/ow2-proactive/scheduling.git","svn_url":"https://github.com/ow2-proactive/scheduling","homepage":"http://www.activeeon.com/workflows-scheduling","size":72986,"stargazers_count":23,"watchers_count":23,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"archived":false,"open_issues_count":173,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":38,"open_issues":173,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/3132"},"html":{"href":"https://github.com/ow2-proactive/scheduling/pull/3132"},"issue":{"href":"https://api.github.com/repos/ow2-proactive/scheduling/issues/3132"},"comments":{"href":"https://api.github.com/repos/ow2-proactive/scheduling/issues/3132/comments"},"review_comments":{"href":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/3132/comments"},"review_comment":{"href":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ow2-proactive/scheduling/pulls/3132/commits"},"statuses":{"href":"https://api.github.com/repos/ow2-proactive/scheduling/statuses/4b2ac99348520c4ad2f928e7a3ca91ce98e5d57d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jrochas"}}