{"action":"created","comment":{"url":"https://api.github.com/repos/http4s/http4s/pulls/comments/199987740","pull_request_review_id":134213441,"id":199987740,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTk4Nzc0MA==","diff_hunk":"@@ -317,11 +326,9 @@ private final class PoolManager[F[_], A <: Connection[F]](\n     */\n   private def disposeConnection(key: RequestKey, connection: Option[A]): Unit = {\n     logger.debug(s\"Disposing of connection: $stats\")\n-    synchronized {\n-      decrConnection(key)\n-      connection.foreach { s =>\n-        if (!s.isClosed) s.shutdown()\n-      }\n+    decrConnection(key)","path":"client/src/main/scala/org/http4s/client/PoolManager.scala","position":347,"original_position":347,"commit_id":"05b3b7c6a64b699c53ee94d9a9c09e9667d9b9a8","original_commit_id":"05b3b7c6a64b699c53ee94d9a9c09e9667d9b9a8","user":{"login":"tbrown1979","id":3231194,"node_id":"MDQ6VXNlcjMyMzExOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3231194?v=4","gravatar_id":"","url":"https://api.github.com/users/tbrown1979","html_url":"https://github.com/tbrown1979","followers_url":"https://api.github.com/users/tbrown1979/followers","following_url":"https://api.github.com/users/tbrown1979/following{/other_user}","gists_url":"https://api.github.com/users/tbrown1979/gists{/gist_id}","starred_url":"https://api.github.com/users/tbrown1979/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbrown1979/subscriptions","organizations_url":"https://api.github.com/users/tbrown1979/orgs","repos_url":"https://api.github.com/users/tbrown1979/repos","events_url":"https://api.github.com/users/tbrown1979/events{/privacy}","received_events_url":"https://api.github.com/users/tbrown1979/received_events","type":"User","site_admin":false},"body":"@jmcardon Good catch. I will get this fixed!","created_at":"2018-07-04T01:19:41Z","updated_at":"2018-07-04T01:19:41Z","html_url":"https://github.com/http4s/http4s/pull/1934#discussion_r199987740","pull_request_url":"https://api.github.com/repos/http4s/http4s/pulls/1934","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/http4s/http4s/pulls/comments/199987740"},"html":{"href":"https://github.com/http4s/http4s/pull/1934#discussion_r199987740"},"pull_request":{"href":"https://api.github.com/repos/http4s/http4s/pulls/1934"}},"in_reply_to_id":199970215},"pull_request":{"url":"https://api.github.com/repos/http4s/http4s/pulls/1934","id":199094836,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MDk0ODM2","html_url":"https://github.com/http4s/http4s/pull/1934","diff_url":"https://github.com/http4s/http4s/pull/1934.diff","patch_url":"https://github.com/http4s/http4s/pull/1934.patch","issue_url":"https://api.github.com/repos/http4s/http4s/issues/1934","number":1934,"state":"open","locked":false,"title":"[PoolManager] - Synchronized -> Semaphore, wrap side-effects in Effect[F].delay","user":{"login":"tbrown1979","id":3231194,"node_id":"MDQ6VXNlcjMyMzExOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3231194?v=4","gravatar_id":"","url":"https://api.github.com/users/tbrown1979","html_url":"https://github.com/tbrown1979","followers_url":"https://api.github.com/users/tbrown1979/followers","following_url":"https://api.github.com/users/tbrown1979/following{/other_user}","gists_url":"https://api.github.com/users/tbrown1979/gists{/gist_id}","starred_url":"https://api.github.com/users/tbrown1979/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbrown1979/subscriptions","organizations_url":"https://api.github.com/users/tbrown1979/orgs","repos_url":"https://api.github.com/users/tbrown1979/repos","events_url":"https://api.github.com/users/tbrown1979/events{/privacy}","received_events_url":"https://api.github.com/users/tbrown1979/received_events","type":"User","site_admin":false},"body":"This PR is an attempt to change the use of `synchronized { ... }` to using a `Semaphore`. To make this easier I wrapped all the `Unit` functions in `F` so that `.acquire`ing a permit was easier. I opted to `.acquire` and `release` the permits instead of doing `.withPermit` just so we could be explicit in all the cases during the `.borrow` method. Doing so allowed me to push the async handling down to the specific cases that require it, instead of every case hitting the callback.\r\n\r\nThis is the first step towards purifying the `PoolManager` and hopefully making it a little more easy to reason about. I have plans for further changes after this, such as removing the `var`s. \r\n\r\nThoughts are appreciated 😄If you'd like to see this done a different way I'm all ears!\r\n","created_at":"2018-07-03T22:07:32Z","updated_at":"2018-07-04T01:19:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00ab0bb4863385fd5c41567439fadc30a12ccd0b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/http4s/http4s/pulls/1934/commits","review_comments_url":"https://api.github.com/repos/http4s/http4s/pulls/1934/comments","review_comment_url":"https://api.github.com/repos/http4s/http4s/pulls/comments{/number}","comments_url":"https://api.github.com/repos/http4s/http4s/issues/1934/comments","statuses_url":"https://api.github.com/repos/http4s/http4s/statuses/05b3b7c6a64b699c53ee94d9a9c09e9667d9b9a8","head":{"label":"tbrown1979:attempt-at-purifying-pool-mgr","ref":"attempt-at-purifying-pool-mgr","sha":"05b3b7c6a64b699c53ee94d9a9c09e9667d9b9a8","user":{"login":"tbrown1979","id":3231194,"node_id":"MDQ6VXNlcjMyMzExOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3231194?v=4","gravatar_id":"","url":"https://api.github.com/users/tbrown1979","html_url":"https://github.com/tbrown1979","followers_url":"https://api.github.com/users/tbrown1979/followers","following_url":"https://api.github.com/users/tbrown1979/following{/other_user}","gists_url":"https://api.github.com/users/tbrown1979/gists{/gist_id}","starred_url":"https://api.github.com/users/tbrown1979/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbrown1979/subscriptions","organizations_url":"https://api.github.com/users/tbrown1979/orgs","repos_url":"https://api.github.com/users/tbrown1979/repos","events_url":"https://api.github.com/users/tbrown1979/events{/privacy}","received_events_url":"https://api.github.com/users/tbrown1979/received_events","type":"User","site_admin":false},"repo":{"id":137396870,"node_id":"MDEwOlJlcG9zaXRvcnkxMzczOTY4NzA=","name":"http4s","full_name":"tbrown1979/http4s","owner":{"login":"tbrown1979","id":3231194,"node_id":"MDQ6VXNlcjMyMzExOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/3231194?v=4","gravatar_id":"","url":"https://api.github.com/users/tbrown1979","html_url":"https://github.com/tbrown1979","followers_url":"https://api.github.com/users/tbrown1979/followers","following_url":"https://api.github.com/users/tbrown1979/following{/other_user}","gists_url":"https://api.github.com/users/tbrown1979/gists{/gist_id}","starred_url":"https://api.github.com/users/tbrown1979/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbrown1979/subscriptions","organizations_url":"https://api.github.com/users/tbrown1979/orgs","repos_url":"https://api.github.com/users/tbrown1979/repos","events_url":"https://api.github.com/users/tbrown1979/events{/privacy}","received_events_url":"https://api.github.com/users/tbrown1979/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tbrown1979/http4s","description":"A minimal, idiomatic Scala interface for HTTP","fork":true,"url":"https://api.github.com/repos/tbrown1979/http4s","forks_url":"https://api.github.com/repos/tbrown1979/http4s/forks","keys_url":"https://api.github.com/repos/tbrown1979/http4s/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tbrown1979/http4s/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tbrown1979/http4s/teams","hooks_url":"https://api.github.com/repos/tbrown1979/http4s/hooks","issue_events_url":"https://api.github.com/repos/tbrown1979/http4s/issues/events{/number}","events_url":"https://api.github.com/repos/tbrown1979/http4s/events","assignees_url":"https://api.github.com/repos/tbrown1979/http4s/assignees{/user}","branches_url":"https://api.github.com/repos/tbrown1979/http4s/branches{/branch}","tags_url":"https://api.github.com/repos/tbrown1979/http4s/tags","blobs_url":"https://api.github.com/repos/tbrown1979/http4s/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tbrown1979/http4s/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tbrown1979/http4s/git/refs{/sha}","trees_url":"https://api.github.com/repos/tbrown1979/http4s/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tbrown1979/http4s/statuses/{sha}","languages_url":"https://api.github.com/repos/tbrown1979/http4s/languages","stargazers_url":"https://api.github.com/repos/tbrown1979/http4s/stargazers","contributors_url":"https://api.github.com/repos/tbrown1979/http4s/contributors","subscribers_url":"https://api.github.com/repos/tbrown1979/http4s/subscribers","subscription_url":"https://api.github.com/repos/tbrown1979/http4s/subscription","commits_url":"https://api.github.com/repos/tbrown1979/http4s/commits{/sha}","git_commits_url":"https://api.github.com/repos/tbrown1979/http4s/git/commits{/sha}","comments_url":"https://api.github.com/repos/tbrown1979/http4s/comments{/number}","issue_comment_url":"https://api.github.com/repos/tbrown1979/http4s/issues/comments{/number}","contents_url":"https://api.github.com/repos/tbrown1979/http4s/contents/{+path}","compare_url":"https://api.github.com/repos/tbrown1979/http4s/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tbrown1979/http4s/merges","archive_url":"https://api.github.com/repos/tbrown1979/http4s/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tbrown1979/http4s/downloads","issues_url":"https://api.github.com/repos/tbrown1979/http4s/issues{/number}","pulls_url":"https://api.github.com/repos/tbrown1979/http4s/pulls{/number}","milestones_url":"https://api.github.com/repos/tbrown1979/http4s/milestones{/number}","notifications_url":"https://api.github.com/repos/tbrown1979/http4s/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tbrown1979/http4s/labels{/name}","releases_url":"https://api.github.com/repos/tbrown1979/http4s/releases{/id}","deployments_url":"https://api.github.com/repos/tbrown1979/http4s/deployments","created_at":"2018-06-14T18:53:32Z","updated_at":"2018-06-14T18:53:37Z","pushed_at":"2018-07-03T22:28:27Z","git_url":"git://github.com/tbrown1979/http4s.git","ssh_url":"git@github.com:tbrown1979/http4s.git","clone_url":"https://github.com/tbrown1979/http4s.git","svn_url":"https://github.com/tbrown1979/http4s","homepage":"https://http4s.org/","size":124546,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"http4s:master","ref":"master","sha":"286fd920d6995bf699fdfcbefe806367a09611a8","user":{"login":"http4s","id":1527492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1Mjc0OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/1527492?v=4","gravatar_id":"","url":"https://api.github.com/users/http4s","html_url":"https://github.com/http4s","followers_url":"https://api.github.com/users/http4s/followers","following_url":"https://api.github.com/users/http4s/following{/other_user}","gists_url":"https://api.github.com/users/http4s/gists{/gist_id}","starred_url":"https://api.github.com/users/http4s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/http4s/subscriptions","organizations_url":"https://api.github.com/users/http4s/orgs","repos_url":"https://api.github.com/users/http4s/repos","events_url":"https://api.github.com/users/http4s/events{/privacy}","received_events_url":"https://api.github.com/users/http4s/received_events","type":"Organization","site_admin":false},"repo":{"id":3692188,"node_id":"MDEwOlJlcG9zaXRvcnkzNjkyMTg4","name":"http4s","full_name":"http4s/http4s","owner":{"login":"http4s","id":1527492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1Mjc0OTI=","avatar_url":"https://avatars3.githubusercontent.com/u/1527492?v=4","gravatar_id":"","url":"https://api.github.com/users/http4s","html_url":"https://github.com/http4s","followers_url":"https://api.github.com/users/http4s/followers","following_url":"https://api.github.com/users/http4s/following{/other_user}","gists_url":"https://api.github.com/users/http4s/gists{/gist_id}","starred_url":"https://api.github.com/users/http4s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/http4s/subscriptions","organizations_url":"https://api.github.com/users/http4s/orgs","repos_url":"https://api.github.com/users/http4s/repos","events_url":"https://api.github.com/users/http4s/events{/privacy}","received_events_url":"https://api.github.com/users/http4s/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/http4s/http4s","description":"A minimal, idiomatic Scala interface for HTTP","fork":false,"url":"https://api.github.com/repos/http4s/http4s","forks_url":"https://api.github.com/repos/http4s/http4s/forks","keys_url":"https://api.github.com/repos/http4s/http4s/keys{/key_id}","collaborators_url":"https://api.github.com/repos/http4s/http4s/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/http4s/http4s/teams","hooks_url":"https://api.github.com/repos/http4s/http4s/hooks","issue_events_url":"https://api.github.com/repos/http4s/http4s/issues/events{/number}","events_url":"https://api.github.com/repos/http4s/http4s/events","assignees_url":"https://api.github.com/repos/http4s/http4s/assignees{/user}","branches_url":"https://api.github.com/repos/http4s/http4s/branches{/branch}","tags_url":"https://api.github.com/repos/http4s/http4s/tags","blobs_url":"https://api.github.com/repos/http4s/http4s/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/http4s/http4s/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/http4s/http4s/git/refs{/sha}","trees_url":"https://api.github.com/repos/http4s/http4s/git/trees{/sha}","statuses_url":"https://api.github.com/repos/http4s/http4s/statuses/{sha}","languages_url":"https://api.github.com/repos/http4s/http4s/languages","stargazers_url":"https://api.github.com/repos/http4s/http4s/stargazers","contributors_url":"https://api.github.com/repos/http4s/http4s/contributors","subscribers_url":"https://api.github.com/repos/http4s/http4s/subscribers","subscription_url":"https://api.github.com/repos/http4s/http4s/subscription","commits_url":"https://api.github.com/repos/http4s/http4s/commits{/sha}","git_commits_url":"https://api.github.com/repos/http4s/http4s/git/commits{/sha}","comments_url":"https://api.github.com/repos/http4s/http4s/comments{/number}","issue_comment_url":"https://api.github.com/repos/http4s/http4s/issues/comments{/number}","contents_url":"https://api.github.com/repos/http4s/http4s/contents/{+path}","compare_url":"https://api.github.com/repos/http4s/http4s/compare/{base}...{head}","merges_url":"https://api.github.com/repos/http4s/http4s/merges","archive_url":"https://api.github.com/repos/http4s/http4s/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/http4s/http4s/downloads","issues_url":"https://api.github.com/repos/http4s/http4s/issues{/number}","pulls_url":"https://api.github.com/repos/http4s/http4s/pulls{/number}","milestones_url":"https://api.github.com/repos/http4s/http4s/milestones{/number}","notifications_url":"https://api.github.com/repos/http4s/http4s/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/http4s/http4s/labels{/name}","releases_url":"https://api.github.com/repos/http4s/http4s/releases{/id}","deployments_url":"https://api.github.com/repos/http4s/http4s/deployments","created_at":"2012-03-12T04:41:20Z","updated_at":"2018-07-03T21:30:03Z","pushed_at":"2018-07-04T00:52:11Z","git_url":"git://github.com/http4s/http4s.git","ssh_url":"git@github.com:http4s/http4s.git","clone_url":"https://github.com/http4s/http4s.git","svn_url":"https://github.com/http4s/http4s","homepage":"https://http4s.org/","size":125922,"stargazers_count":1114,"watchers_count":1114,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":302,"mirror_url":null,"archived":false,"open_issues_count":130,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":302,"open_issues":130,"watchers":1114,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/http4s/http4s/pulls/1934"},"html":{"href":"https://github.com/http4s/http4s/pull/1934"},"issue":{"href":"https://api.github.com/repos/http4s/http4s/issues/1934"},"comments":{"href":"https://api.github.com/repos/http4s/http4s/issues/1934/comments"},"review_comments":{"href":"https://api.github.com/repos/http4s/http4s/pulls/1934/comments"},"review_comment":{"href":"https://api.github.com/repos/http4s/http4s/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/http4s/http4s/pulls/1934/commits"},"statuses":{"href":"https://api.github.com/repos/http4s/http4s/statuses/05b3b7c6a64b699c53ee94d9a9c09e9667d9b9a8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tbrown1979"}}