{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments/48883448","id":48883448,"diff_hunk":"@@ -15,7 +15,16 @@\n (defn jruby-service-test-config\n   [pool-size]\n   (jruby-testutils/jruby-puppet-tk-config\n-    (jruby-testutils/jruby-puppet-config {:max-active-instances pool-size})))\n+    (jruby-testutils/jruby-puppet-config {:max-active-instances pool-size\n+                                          :borrow-timeout 1})))","path":"test/integration/puppetlabs/services/jruby/jruby_locking_test.clj","position":6,"original_position":6,"commit_id":"864f9ed42253a95e973f1fc461612dae965aa8b6","original_commit_id":"864f9ed42253a95e973f1fc461612dae965aa8b6","user":{"login":"cprice404","id":1341071,"avatar_url":"https://avatars.githubusercontent.com/u/1341071?v=3","gravatar_id":"","url":"https://api.github.com/users/cprice404","html_url":"https://github.com/cprice404","followers_url":"https://api.github.com/users/cprice404/followers","following_url":"https://api.github.com/users/cprice404/following{/other_user}","gists_url":"https://api.github.com/users/cprice404/gists{/gist_id}","starred_url":"https://api.github.com/users/cprice404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cprice404/subscriptions","organizations_url":"https://api.github.com/users/cprice404/orgs","repos_url":"https://api.github.com/users/cprice404/repos","events_url":"https://api.github.com/users/cprice404/events{/privacy}","received_events_url":"https://api.github.com/users/cprice404/received_events","type":"User","site_admin":false},"body":"~legit","created_at":"2016-01-05T19:13:51Z","updated_at":"2016-01-05T19:13:51Z","html_url":"https://github.com/puppetlabs/puppet-server/pull/813#discussion_r48883448","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/813","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments/48883448"},"html":{"href":"https://github.com/puppetlabs/puppet-server/pull/813#discussion_r48883448"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/813"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/813","id":53452761,"html_url":"https://github.com/puppetlabs/puppet-server/pull/813","diff_url":"https://github.com/puppetlabs/puppet-server/pull/813.diff","patch_url":"https://github.com/puppetlabs/puppet-server/pull/813.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues/813","number":813,"state":"open","locked":false,"title":"(SERVER-862) Enable jruby pool write locker to borrow pool instances","user":{"login":"camlow325","id":5652737,"avatar_url":"https://avatars.githubusercontent.com/u/5652737?v=3","gravatar_id":"","url":"https://api.github.com/users/camlow325","html_url":"https://github.com/camlow325","followers_url":"https://api.github.com/users/camlow325/followers","following_url":"https://api.github.com/users/camlow325/following{/other_user}","gists_url":"https://api.github.com/users/camlow325/gists{/gist_id}","starred_url":"https://api.github.com/users/camlow325/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camlow325/subscriptions","organizations_url":"https://api.github.com/users/camlow325/orgs","repos_url":"https://api.github.com/users/camlow325/repos","events_url":"https://api.github.com/users/camlow325/events{/privacy}","received_events_url":"https://api.github.com/users/camlow325/received_events","type":"User","site_admin":false},"body":"This PR reworks the `JRubyPool` implementation to pull in all of the\r\nconcurrent constructs around a single `ReentrantLock`, the primary benefit\r\nbeing to allow the holder of a write lock to be able to borrow instances\r\nfrom the pool without running the risk of a deadlock due to competing\r\nborrows that may be occurring from other threads.  The implementation\r\nuses three condition variables to gate borrower and locker access to the\r\npool, similar to how `LinkedBlockingDeque` does for managing queue takers.\r\n\r\nWhere the underlying lock construct in the `JRubyPool` class would be a\r\n`ReentrantLock` instead of a `ReentrantReadWriteLock`, this commit also\r\nreworks a few of the unit tests to attempt borrows from non-locking\r\nthreads as an indication that the write lock is held, as opposed to\r\ntrying to interrogate the lock construct itself.\r\n\r\nThis PR also cleans up the Javadocs for the `LockablePool` interface and\r\n`JRubyPool` class to be less redundant and cover only details that the\r\nconsumer of the two would need to know, pulling internal details about the\r\n`JRubyPool` class into comments within that class.","created_at":"2015-12-11T22:32:12Z","updated_at":"2016-01-05T19:13:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ef1bab1f9e6958fe548a7632bcd056de862145d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/813/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/813/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues/813/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet-server/statuses/864f9ed42253a95e973f1fc461612dae965aa8b6","head":{"label":"camlow325:bug/master/SERVER-862-refactor-jruby-pool-to-allow-borrows-during-write-lock","ref":"bug/master/SERVER-862-refactor-jruby-pool-to-allow-borrows-during-write-lock","sha":"864f9ed42253a95e973f1fc461612dae965aa8b6","user":{"login":"camlow325","id":5652737,"avatar_url":"https://avatars.githubusercontent.com/u/5652737?v=3","gravatar_id":"","url":"https://api.github.com/users/camlow325","html_url":"https://github.com/camlow325","followers_url":"https://api.github.com/users/camlow325/followers","following_url":"https://api.github.com/users/camlow325/following{/other_user}","gists_url":"https://api.github.com/users/camlow325/gists{/gist_id}","starred_url":"https://api.github.com/users/camlow325/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camlow325/subscriptions","organizations_url":"https://api.github.com/users/camlow325/orgs","repos_url":"https://api.github.com/users/camlow325/repos","events_url":"https://api.github.com/users/camlow325/events{/privacy}","received_events_url":"https://api.github.com/users/camlow325/received_events","type":"User","site_admin":false},"repo":{"id":24697001,"name":"puppet-server","full_name":"camlow325/puppet-server","owner":{"login":"camlow325","id":5652737,"avatar_url":"https://avatars.githubusercontent.com/u/5652737?v=3","gravatar_id":"","url":"https://api.github.com/users/camlow325","html_url":"https://github.com/camlow325","followers_url":"https://api.github.com/users/camlow325/followers","following_url":"https://api.github.com/users/camlow325/following{/other_user}","gists_url":"https://api.github.com/users/camlow325/gists{/gist_id}","starred_url":"https://api.github.com/users/camlow325/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camlow325/subscriptions","organizations_url":"https://api.github.com/users/camlow325/orgs","repos_url":"https://api.github.com/users/camlow325/repos","events_url":"https://api.github.com/users/camlow325/events{/privacy}","received_events_url":"https://api.github.com/users/camlow325/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/camlow325/puppet-server","description":"Server automation framework and application","fork":true,"url":"https://api.github.com/repos/camlow325/puppet-server","forks_url":"https://api.github.com/repos/camlow325/puppet-server/forks","keys_url":"https://api.github.com/repos/camlow325/puppet-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/camlow325/puppet-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/camlow325/puppet-server/teams","hooks_url":"https://api.github.com/repos/camlow325/puppet-server/hooks","issue_events_url":"https://api.github.com/repos/camlow325/puppet-server/issues/events{/number}","events_url":"https://api.github.com/repos/camlow325/puppet-server/events","assignees_url":"https://api.github.com/repos/camlow325/puppet-server/assignees{/user}","branches_url":"https://api.github.com/repos/camlow325/puppet-server/branches{/branch}","tags_url":"https://api.github.com/repos/camlow325/puppet-server/tags","blobs_url":"https://api.github.com/repos/camlow325/puppet-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/camlow325/puppet-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/camlow325/puppet-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/camlow325/puppet-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/camlow325/puppet-server/statuses/{sha}","languages_url":"https://api.github.com/repos/camlow325/puppet-server/languages","stargazers_url":"https://api.github.com/repos/camlow325/puppet-server/stargazers","contributors_url":"https://api.github.com/repos/camlow325/puppet-server/contributors","subscribers_url":"https://api.github.com/repos/camlow325/puppet-server/subscribers","subscription_url":"https://api.github.com/repos/camlow325/puppet-server/subscription","commits_url":"https://api.github.com/repos/camlow325/puppet-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/camlow325/puppet-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/camlow325/puppet-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/camlow325/puppet-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/camlow325/puppet-server/contents/{+path}","compare_url":"https://api.github.com/repos/camlow325/puppet-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/camlow325/puppet-server/merges","archive_url":"https://api.github.com/repos/camlow325/puppet-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/camlow325/puppet-server/downloads","issues_url":"https://api.github.com/repos/camlow325/puppet-server/issues{/number}","pulls_url":"https://api.github.com/repos/camlow325/puppet-server/pulls{/number}","milestones_url":"https://api.github.com/repos/camlow325/puppet-server/milestones{/number}","notifications_url":"https://api.github.com/repos/camlow325/puppet-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/camlow325/puppet-server/labels{/name}","releases_url":"https://api.github.com/repos/camlow325/puppet-server/releases{/id}","created_at":"2014-10-01T21:59:27Z","updated_at":"2015-04-27T20:24:39Z","pushed_at":"2016-01-04T23:31:58Z","git_url":"git://github.com/camlow325/puppet-server.git","ssh_url":"git@github.com:camlow325/puppet-server.git","clone_url":"https://github.com/camlow325/puppet-server.git","svn_url":"https://github.com/camlow325/puppet-server","homepage":"https://tickets.puppetlabs.com/browse/SERVER","size":2917,"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":"c1c5db0351ba9da4f32ddb9ca64b489945255971","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":19546488,"name":"puppet-server","full_name":"puppetlabs/puppet-server","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/puppet-server","description":"Server automation framework and application","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppet-server","forks_url":"https://api.github.com/repos/puppetlabs/puppet-server/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppet-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppet-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppet-server/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppet-server/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppet-server/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppet-server/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppet-server/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppet-server/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppet-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppet-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppet-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppet-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppet-server/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppet-server/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppet-server/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppet-server/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppet-server/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppet-server/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppet-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppet-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppet-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppet-server/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppet-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppet-server/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppet-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppet-server/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppet-server/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppet-server/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppet-server/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppet-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppet-server/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppet-server/releases{/id}","created_at":"2014-05-07T19:00:24Z","updated_at":"2015-12-16T22:17:46Z","pushed_at":"2016-01-04T23:31:58Z","git_url":"git://github.com/puppetlabs/puppet-server.git","ssh_url":"git@github.com:puppetlabs/puppet-server.git","clone_url":"https://github.com/puppetlabs/puppet-server.git","svn_url":"https://github.com/puppetlabs/puppet-server","homepage":"https://tickets.puppetlabs.com/browse/SERVER","size":4873,"stargazers_count":124,"watchers_count":124,"language":"Clojure","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":78,"mirror_url":null,"open_issues_count":8,"forks":78,"open_issues":8,"watchers":124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/813"},"html":{"href":"https://github.com/puppetlabs/puppet-server/pull/813"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/issues/813"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/issues/813/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/813/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/pulls/813/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet-server/statuses/864f9ed42253a95e973f1fc461612dae965aa8b6"}}}}