{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/comments/93669531","pull_request_review_id":14202480,"id":93669531,"diff_hunk":"@@ -86,87 +105,101 @@\n    pool :- jruby-schemas/pool-queue-type]\n   (= expected-pool-size (count (.getRegisteredElements pool))))\n \n-(schema/defn ^:always-validate\n-  swap-and-drain-pool!\n-  \"Replace the current pool with a new pool and drain the old pool,\n-  optionally refilling the new pool with fresh jrubies.\"\n+(schema/defn collect-all-jrubies :- [JRubyInstance]\n+  \"Locks the pool and borrows all the instances\"\n+  [pool-state :- jruby-schemas/PoolState]\n+  (let [pool-size (:size pool-state)\n+        pool (:pool pool-state)\n+        borrow-fn (fn [_] (jruby-internal/borrow-from-pool!*\n+                           jruby-internal/borrow-without-timeout-fn\n+                           pool))]\n+    (.lock pool)\n+    (try\n+      (mapv borrow-fn (range pool-size))\n+      (catch Exception e\n+        (.clear pool)\n+        (.insertPill pool (PoisonPill. e))\n+        (throw (IllegalStateException.","path":"src/clj/puppetlabs/services/jruby_pool_manager/impl/jruby_agents.clj","position":111,"original_position":111,"commit_id":"58876bcb58fc58d1cb921e1686f06c1e4fa0e66e","original_commit_id":"58876bcb58fc58d1cb921e1686f06c1e4fa0e66e","user":{"login":"jpinsonault","id":137581,"avatar_url":"https://avatars.githubusercontent.com/u/137581?v=3","gravatar_id":"","url":"https://api.github.com/users/jpinsonault","html_url":"https://github.com/jpinsonault","followers_url":"https://api.github.com/users/jpinsonault/followers","following_url":"https://api.github.com/users/jpinsonault/following{/other_user}","gists_url":"https://api.github.com/users/jpinsonault/gists{/gist_id}","starred_url":"https://api.github.com/users/jpinsonault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpinsonault/subscriptions","organizations_url":"https://api.github.com/users/jpinsonault/orgs","repos_url":"https://api.github.com/users/jpinsonault/repos","events_url":"https://api.github.com/users/jpinsonault/events{/privacy}","received_events_url":"https://api.github.com/users/jpinsonault/received_events","type":"User","site_admin":false},"body":"ahh, thanks for explaining that. Will do","created_at":"2016-12-22T18:00:57Z","updated_at":"2016-12-22T18:00:57Z","html_url":"https://github.com/puppetlabs/jruby-utils/pull/34#discussion_r93669531","pull_request_url":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/comments/93669531"},"html":{"href":"https://github.com/puppetlabs/jruby-utils/pull/34#discussion_r93669531"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/34","id":97353307,"html_url":"https://github.com/puppetlabs/jruby-utils/pull/34","diff_url":"https://github.com/puppetlabs/jruby-utils/pull/34.diff","patch_url":"https://github.com/puppetlabs/jruby-utils/pull/34.patch","issue_url":"https://api.github.com/repos/puppetlabs/jruby-utils/issues/34","number":34,"state":"open","locked":false,"title":"(DO NOT MERGE) (PE-13552) Refactor jruby pool to use one pool","user":{"login":"jpinsonault","id":137581,"avatar_url":"https://avatars.githubusercontent.com/u/137581?v=3","gravatar_id":"","url":"https://api.github.com/users/jpinsonault","html_url":"https://github.com/jpinsonault","followers_url":"https://api.github.com/users/jpinsonault/followers","following_url":"https://api.github.com/users/jpinsonault/following{/other_user}","gists_url":"https://api.github.com/users/jpinsonault/gists{/gist_id}","starred_url":"https://api.github.com/users/jpinsonault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpinsonault/subscriptions","organizations_url":"https://api.github.com/users/jpinsonault/orgs","repos_url":"https://api.github.com/users/jpinsonault/repos","events_url":"https://api.github.com/users/jpinsonault/events{/privacy}","received_events_url":"https://api.github.com/users/jpinsonault/received_events","type":"User","site_admin":false},"body":"This PR modifies the flush logic to avoid the need for two pools,\r\nwhich would get swapped out when a flush occurred.\r\n\r\nIt also removes the pool-agent and relies on the locking the pool to resolve multiple flush requests happening at once. Without pool swapping, the retry poison pill isn't needed anymore either.\r\n\r\nThe flush-instance-agent now takes the form of a modify-instance-agent,\r\nso that any operations which create or destroy a jruby must go through\r\nthis agent\r\n\r\n----\r\n\r\nThis should not be merged yet. It hasn't been integrated with puppetserver yet, and causes some test failures there. But it's in a good enough state to review","created_at":"2016-12-09T18:00:46Z","updated_at":"2016-12-22T18:00:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d713bf6427345ac35da201f0ee1bd64afca7c91","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/34/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/34/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/jruby-utils/issues/34/comments","statuses_url":"https://api.github.com/repos/puppetlabs/jruby-utils/statuses/58876bcb58fc58d1cb921e1686f06c1e4fa0e66e","head":{"label":"jpinsonault:pe-13552-file-sync-pool-locking-refactor","ref":"pe-13552-file-sync-pool-locking-refactor","sha":"58876bcb58fc58d1cb921e1686f06c1e4fa0e66e","user":{"login":"jpinsonault","id":137581,"avatar_url":"https://avatars.githubusercontent.com/u/137581?v=3","gravatar_id":"","url":"https://api.github.com/users/jpinsonault","html_url":"https://github.com/jpinsonault","followers_url":"https://api.github.com/users/jpinsonault/followers","following_url":"https://api.github.com/users/jpinsonault/following{/other_user}","gists_url":"https://api.github.com/users/jpinsonault/gists{/gist_id}","starred_url":"https://api.github.com/users/jpinsonault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpinsonault/subscriptions","organizations_url":"https://api.github.com/users/jpinsonault/orgs","repos_url":"https://api.github.com/users/jpinsonault/repos","events_url":"https://api.github.com/users/jpinsonault/events{/privacy}","received_events_url":"https://api.github.com/users/jpinsonault/received_events","type":"User","site_admin":false},"repo":{"id":58164219,"name":"jruby-utils","full_name":"jpinsonault/jruby-utils","owner":{"login":"jpinsonault","id":137581,"avatar_url":"https://avatars.githubusercontent.com/u/137581?v=3","gravatar_id":"","url":"https://api.github.com/users/jpinsonault","html_url":"https://github.com/jpinsonault","followers_url":"https://api.github.com/users/jpinsonault/followers","following_url":"https://api.github.com/users/jpinsonault/following{/other_user}","gists_url":"https://api.github.com/users/jpinsonault/gists{/gist_id}","starred_url":"https://api.github.com/users/jpinsonault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpinsonault/subscriptions","organizations_url":"https://api.github.com/users/jpinsonault/orgs","repos_url":"https://api.github.com/users/jpinsonault/repos","events_url":"https://api.github.com/users/jpinsonault/events{/privacy}","received_events_url":"https://api.github.com/users/jpinsonault/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpinsonault/jruby-utils","description":"Tools for working with JRuby from Clojure","fork":true,"url":"https://api.github.com/repos/jpinsonault/jruby-utils","forks_url":"https://api.github.com/repos/jpinsonault/jruby-utils/forks","keys_url":"https://api.github.com/repos/jpinsonault/jruby-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpinsonault/jruby-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpinsonault/jruby-utils/teams","hooks_url":"https://api.github.com/repos/jpinsonault/jruby-utils/hooks","issue_events_url":"https://api.github.com/repos/jpinsonault/jruby-utils/issues/events{/number}","events_url":"https://api.github.com/repos/jpinsonault/jruby-utils/events","assignees_url":"https://api.github.com/repos/jpinsonault/jruby-utils/assignees{/user}","branches_url":"https://api.github.com/repos/jpinsonault/jruby-utils/branches{/branch}","tags_url":"https://api.github.com/repos/jpinsonault/jruby-utils/tags","blobs_url":"https://api.github.com/repos/jpinsonault/jruby-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpinsonault/jruby-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpinsonault/jruby-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpinsonault/jruby-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpinsonault/jruby-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/jpinsonault/jruby-utils/languages","stargazers_url":"https://api.github.com/repos/jpinsonault/jruby-utils/stargazers","contributors_url":"https://api.github.com/repos/jpinsonault/jruby-utils/contributors","subscribers_url":"https://api.github.com/repos/jpinsonault/jruby-utils/subscribers","subscription_url":"https://api.github.com/repos/jpinsonault/jruby-utils/subscription","commits_url":"https://api.github.com/repos/jpinsonault/jruby-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpinsonault/jruby-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpinsonault/jruby-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpinsonault/jruby-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpinsonault/jruby-utils/contents/{+path}","compare_url":"https://api.github.com/repos/jpinsonault/jruby-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpinsonault/jruby-utils/merges","archive_url":"https://api.github.com/repos/jpinsonault/jruby-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpinsonault/jruby-utils/downloads","issues_url":"https://api.github.com/repos/jpinsonault/jruby-utils/issues{/number}","pulls_url":"https://api.github.com/repos/jpinsonault/jruby-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/jpinsonault/jruby-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/jpinsonault/jruby-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpinsonault/jruby-utils/labels{/name}","releases_url":"https://api.github.com/repos/jpinsonault/jruby-utils/releases{/id}","deployments_url":"https://api.github.com/repos/jpinsonault/jruby-utils/deployments","created_at":"2016-05-05T22:21:32Z","updated_at":"2016-05-05T22:21:33Z","pushed_at":"2016-12-21T22:09:01Z","git_url":"git://github.com/jpinsonault/jruby-utils.git","ssh_url":"git@github.com:jpinsonault/jruby-utils.git","clone_url":"https://github.com/jpinsonault/jruby-utils.git","svn_url":"https://github.com/jpinsonault/jruby-utils","homepage":null,"size":3835,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"puppetlabs:master","ref":"master","sha":"05fd0ac11c3d346a0fbd747837683c969dfbc497","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":54928848,"name":"jruby-utils","full_name":"puppetlabs/jruby-utils","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/jruby-utils","description":"Tools for working with JRuby from Clojure","fork":false,"url":"https://api.github.com/repos/puppetlabs/jruby-utils","forks_url":"https://api.github.com/repos/puppetlabs/jruby-utils/forks","keys_url":"https://api.github.com/repos/puppetlabs/jruby-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/jruby-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/jruby-utils/teams","hooks_url":"https://api.github.com/repos/puppetlabs/jruby-utils/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/jruby-utils/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/jruby-utils/events","assignees_url":"https://api.github.com/repos/puppetlabs/jruby-utils/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/jruby-utils/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/jruby-utils/tags","blobs_url":"https://api.github.com/repos/puppetlabs/jruby-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/jruby-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/jruby-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/jruby-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/jruby-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/jruby-utils/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/jruby-utils/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/jruby-utils/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/jruby-utils/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/jruby-utils/subscription","commits_url":"https://api.github.com/repos/puppetlabs/jruby-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/jruby-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/jruby-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/jruby-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/jruby-utils/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/jruby-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/jruby-utils/merges","archive_url":"https://api.github.com/repos/puppetlabs/jruby-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/jruby-utils/downloads","issues_url":"https://api.github.com/repos/puppetlabs/jruby-utils/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/jruby-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/jruby-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/jruby-utils/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/jruby-utils/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/jruby-utils/deployments","created_at":"2016-03-28T22:45:23Z","updated_at":"2016-11-02T22:43:07Z","pushed_at":"2016-12-21T22:09:02Z","git_url":"git://github.com/puppetlabs/jruby-utils.git","ssh_url":"git@github.com:puppetlabs/jruby-utils.git","clone_url":"https://github.com/puppetlabs/jruby-utils.git","svn_url":"https://github.com/puppetlabs/jruby-utils","homepage":null,"size":3805,"stargazers_count":2,"watchers_count":2,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":1,"forks":6,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/34"},"html":{"href":"https://github.com/puppetlabs/jruby-utils/pull/34"},"issue":{"href":"https://api.github.com/repos/puppetlabs/jruby-utils/issues/34"},"comments":{"href":"https://api.github.com/repos/puppetlabs/jruby-utils/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/jruby-utils/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/jruby-utils/statuses/58876bcb58fc58d1cb921e1686f06c1e4fa0e66e"}}}}
{"actor":{"display_login":"jpinsonault"}}