{"action":"created","comment":{"url":"https://api.github.com/repos/slick/slick/pulls/comments/171619100","pull_request_review_id":100491267,"id":171619100,"diff_hunk":"@@ -135,81 +137,64 @@ class ManagedArrayBlockingQueue[E >: Null <: PrioritizedRunnable](maximumInUse:\n     }\n   }\n \n-  def size: Int = locked(counts)\n+  // how many items in the queue\n+  def size: Int = locked(itemQueue.count + highPrioItemQueue.count) // can't use `counts`\n+                                                                    // here, it refers to\n+                                                                    // `paused`\n \n-  def remainingCapacity: Int = locked(capacity - itemQueue.count - highPrioItemQueue.count)\n+  // how much normal capacity we have left before put/offer start blocking\n+  def remainingCapacity: Int = math.max(locked(capacity - itemQueue.count), 0)\n \n-  override def remove(o: AnyRef): Boolean = if (o eq null) false else {\n-    locked {\n-      if (highPrioItemQueue.remove(o)) {\n-        true\n-      } else {\n-        itemQueue.remove(o)\n-      }\n+  override def remove(o: AnyRef): Boolean = if (o eq null) false else locked {","path":"slick/src/main/scala/slick/util/ManagedArrayBlockingQueue.scala","position":155,"original_position":155,"commit_id":"77c974870663e97a083b3740103842fb0f087fa5","original_commit_id":"77c974870663e97a083b3740103842fb0f087fa5","user":{"login":"kwark","id":629786,"avatar_url":"https://avatars2.githubusercontent.com/u/629786?v=4","gravatar_id":"","url":"https://api.github.com/users/kwark","html_url":"https://github.com/kwark","followers_url":"https://api.github.com/users/kwark/followers","following_url":"https://api.github.com/users/kwark/following{/other_user}","gists_url":"https://api.github.com/users/kwark/gists{/gist_id}","starred_url":"https://api.github.com/users/kwark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwark/subscriptions","organizations_url":"https://api.github.com/users/kwark/orgs","repos_url":"https://api.github.com/users/kwark/repos","events_url":"https://api.github.com/users/kwark/events{/privacy}","received_events_url":"https://api.github.com/users/kwark/received_events","type":"User","site_admin":false},"body":"`remove` is AFAICT only ever called when shutting down the AsyncExecutor, which calls `ThreadPoolExecutor.shutdownNow()` and which drains the queue.\r\nBut signalling the itemQueueNotFull condition never hurts.\r\n","created_at":"2018-03-01T16:41:55Z","updated_at":"2018-03-01T16:44:39Z","html_url":"https://github.com/slick/slick/pull/1854#discussion_r171619100","pull_request_url":"https://api.github.com/repos/slick/slick/pulls/1854","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/slick/slick/pulls/comments/171619100"},"html":{"href":"https://github.com/slick/slick/pull/1854#discussion_r171619100"},"pull_request":{"href":"https://api.github.com/repos/slick/slick/pulls/1854"}}},"pull_request":{"url":"https://api.github.com/repos/slick/slick/pulls/1854","id":172157215,"html_url":"https://github.com/slick/slick/pull/1854","diff_url":"https://github.com/slick/slick/pull/1854.diff","patch_url":"https://github.com/slick/slick/pull/1854.patch","issue_url":"https://api.github.com/repos/slick/slick/issues/1854","number":1854,"state":"open","locked":false,"title":"Made ManagedArrayBlockingQueue size not show 0 when it is paused. ","user":{"login":"hvesalai","id":861035,"avatar_url":"https://avatars1.githubusercontent.com/u/861035?v=4","gravatar_id":"","url":"https://api.github.com/users/hvesalai","html_url":"https://github.com/hvesalai","followers_url":"https://api.github.com/users/hvesalai/followers","following_url":"https://api.github.com/users/hvesalai/following{/other_user}","gists_url":"https://api.github.com/users/hvesalai/gists{/gist_id}","starred_url":"https://api.github.com/users/hvesalai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvesalai/subscriptions","organizations_url":"https://api.github.com/users/hvesalai/orgs","repos_url":"https://api.github.com/users/hvesalai/repos","events_url":"https://api.github.com/users/hvesalai/events{/privacy}","received_events_url":"https://api.github.com/users/hvesalai/received_events","type":"User","site_admin":false},"body":"also cleaned up code.\r\n\r\nThis PR changes the definition of ManagedArrayBlockingQueue.size so that it does not return 0 on paused queues. The size is used for example in the exception that is thrown when the queue is full. However without this patch, if the queue is full and paused, the exception will state it has 0 elements.","created_at":"2018-03-01T06:55:11Z","updated_at":"2018-03-01T16:44:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39098b84728824f8983b2f3bd4c6c7a54c0f25fd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/slick/slick/milestones/28","html_url":"https://github.com/slick/slick/milestone/28","labels_url":"https://api.github.com/repos/slick/slick/milestones/28/labels","id":3153124,"number":28,"title":"3.2.2","description":"","creator":{"login":"hvesalai","id":861035,"avatar_url":"https://avatars1.githubusercontent.com/u/861035?v=4","gravatar_id":"","url":"https://api.github.com/users/hvesalai","html_url":"https://github.com/hvesalai","followers_url":"https://api.github.com/users/hvesalai/followers","following_url":"https://api.github.com/users/hvesalai/following{/other_user}","gists_url":"https://api.github.com/users/hvesalai/gists{/gist_id}","starred_url":"https://api.github.com/users/hvesalai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvesalai/subscriptions","organizations_url":"https://api.github.com/users/hvesalai/orgs","repos_url":"https://api.github.com/users/hvesalai/repos","events_url":"https://api.github.com/users/hvesalai/events{/privacy}","received_events_url":"https://api.github.com/users/hvesalai/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":0,"state":"open","created_at":"2018-03-01T10:02:59Z","updated_at":"2018-03-01T10:45:41Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/slick/slick/pulls/1854/commits","review_comments_url":"https://api.github.com/repos/slick/slick/pulls/1854/comments","review_comment_url":"https://api.github.com/repos/slick/slick/pulls/comments{/number}","comments_url":"https://api.github.com/repos/slick/slick/issues/1854/comments","statuses_url":"https://api.github.com/repos/slick/slick/statuses/77c974870663e97a083b3740103842fb0f087fa5","head":{"label":"hvesalai:fix/array-block-queue-zero-size","ref":"fix/array-block-queue-zero-size","sha":"77c974870663e97a083b3740103842fb0f087fa5","user":{"login":"hvesalai","id":861035,"avatar_url":"https://avatars1.githubusercontent.com/u/861035?v=4","gravatar_id":"","url":"https://api.github.com/users/hvesalai","html_url":"https://github.com/hvesalai","followers_url":"https://api.github.com/users/hvesalai/followers","following_url":"https://api.github.com/users/hvesalai/following{/other_user}","gists_url":"https://api.github.com/users/hvesalai/gists{/gist_id}","starred_url":"https://api.github.com/users/hvesalai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvesalai/subscriptions","organizations_url":"https://api.github.com/users/hvesalai/orgs","repos_url":"https://api.github.com/users/hvesalai/repos","events_url":"https://api.github.com/users/hvesalai/events{/privacy}","received_events_url":"https://api.github.com/users/hvesalai/received_events","type":"User","site_admin":false},"repo":{"id":12967674,"name":"slick","full_name":"hvesalai/slick","owner":{"login":"hvesalai","id":861035,"avatar_url":"https://avatars1.githubusercontent.com/u/861035?v=4","gravatar_id":"","url":"https://api.github.com/users/hvesalai","html_url":"https://github.com/hvesalai","followers_url":"https://api.github.com/users/hvesalai/followers","following_url":"https://api.github.com/users/hvesalai/following{/other_user}","gists_url":"https://api.github.com/users/hvesalai/gists{/gist_id}","starred_url":"https://api.github.com/users/hvesalai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvesalai/subscriptions","organizations_url":"https://api.github.com/users/hvesalai/orgs","repos_url":"https://api.github.com/users/hvesalai/repos","events_url":"https://api.github.com/users/hvesalai/events{/privacy}","received_events_url":"https://api.github.com/users/hvesalai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hvesalai/slick","description":"Scala Language Integrated Connection Kit","fork":true,"url":"https://api.github.com/repos/hvesalai/slick","forks_url":"https://api.github.com/repos/hvesalai/slick/forks","keys_url":"https://api.github.com/repos/hvesalai/slick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hvesalai/slick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hvesalai/slick/teams","hooks_url":"https://api.github.com/repos/hvesalai/slick/hooks","issue_events_url":"https://api.github.com/repos/hvesalai/slick/issues/events{/number}","events_url":"https://api.github.com/repos/hvesalai/slick/events","assignees_url":"https://api.github.com/repos/hvesalai/slick/assignees{/user}","branches_url":"https://api.github.com/repos/hvesalai/slick/branches{/branch}","tags_url":"https://api.github.com/repos/hvesalai/slick/tags","blobs_url":"https://api.github.com/repos/hvesalai/slick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hvesalai/slick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hvesalai/slick/git/refs{/sha}","trees_url":"https://api.github.com/repos/hvesalai/slick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hvesalai/slick/statuses/{sha}","languages_url":"https://api.github.com/repos/hvesalai/slick/languages","stargazers_url":"https://api.github.com/repos/hvesalai/slick/stargazers","contributors_url":"https://api.github.com/repos/hvesalai/slick/contributors","subscribers_url":"https://api.github.com/repos/hvesalai/slick/subscribers","subscription_url":"https://api.github.com/repos/hvesalai/slick/subscription","commits_url":"https://api.github.com/repos/hvesalai/slick/commits{/sha}","git_commits_url":"https://api.github.com/repos/hvesalai/slick/git/commits{/sha}","comments_url":"https://api.github.com/repos/hvesalai/slick/comments{/number}","issue_comment_url":"https://api.github.com/repos/hvesalai/slick/issues/comments{/number}","contents_url":"https://api.github.com/repos/hvesalai/slick/contents/{+path}","compare_url":"https://api.github.com/repos/hvesalai/slick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hvesalai/slick/merges","archive_url":"https://api.github.com/repos/hvesalai/slick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hvesalai/slick/downloads","issues_url":"https://api.github.com/repos/hvesalai/slick/issues{/number}","pulls_url":"https://api.github.com/repos/hvesalai/slick/pulls{/number}","milestones_url":"https://api.github.com/repos/hvesalai/slick/milestones{/number}","notifications_url":"https://api.github.com/repos/hvesalai/slick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hvesalai/slick/labels{/name}","releases_url":"https://api.github.com/repos/hvesalai/slick/releases{/id}","deployments_url":"https://api.github.com/repos/hvesalai/slick/deployments","created_at":"2013-09-20T07:12:32Z","updated_at":"2017-11-02T11:12:17Z","pushed_at":"2018-03-01T09:44:56Z","git_url":"git://github.com/hvesalai/slick.git","ssh_url":"git@github.com:hvesalai/slick.git","clone_url":"https://github.com/hvesalai/slick.git","svn_url":"https://github.com/hvesalai/slick","homepage":"http://slick.typesafe.com","size":9357,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"slick:master","ref":"master","sha":"3d4e7c1192c6e782cfae92452e00b1569dd4135b","user":{"login":"slick","id":1752624,"avatar_url":"https://avatars1.githubusercontent.com/u/1752624?v=4","gravatar_id":"","url":"https://api.github.com/users/slick","html_url":"https://github.com/slick","followers_url":"https://api.github.com/users/slick/followers","following_url":"https://api.github.com/users/slick/following{/other_user}","gists_url":"https://api.github.com/users/slick/gists{/gist_id}","starred_url":"https://api.github.com/users/slick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slick/subscriptions","organizations_url":"https://api.github.com/users/slick/orgs","repos_url":"https://api.github.com/users/slick/repos","events_url":"https://api.github.com/users/slick/events{/privacy}","received_events_url":"https://api.github.com/users/slick/received_events","type":"Organization","site_admin":false},"repo":{"id":133684,"name":"slick","full_name":"slick/slick","owner":{"login":"slick","id":1752624,"avatar_url":"https://avatars1.githubusercontent.com/u/1752624?v=4","gravatar_id":"","url":"https://api.github.com/users/slick","html_url":"https://github.com/slick","followers_url":"https://api.github.com/users/slick/followers","following_url":"https://api.github.com/users/slick/following{/other_user}","gists_url":"https://api.github.com/users/slick/gists{/gist_id}","starred_url":"https://api.github.com/users/slick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slick/subscriptions","organizations_url":"https://api.github.com/users/slick/orgs","repos_url":"https://api.github.com/users/slick/repos","events_url":"https://api.github.com/users/slick/events{/privacy}","received_events_url":"https://api.github.com/users/slick/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/slick/slick","description":"Scala Language Integrated Connection Kit","fork":false,"url":"https://api.github.com/repos/slick/slick","forks_url":"https://api.github.com/repos/slick/slick/forks","keys_url":"https://api.github.com/repos/slick/slick/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slick/slick/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slick/slick/teams","hooks_url":"https://api.github.com/repos/slick/slick/hooks","issue_events_url":"https://api.github.com/repos/slick/slick/issues/events{/number}","events_url":"https://api.github.com/repos/slick/slick/events","assignees_url":"https://api.github.com/repos/slick/slick/assignees{/user}","branches_url":"https://api.github.com/repos/slick/slick/branches{/branch}","tags_url":"https://api.github.com/repos/slick/slick/tags","blobs_url":"https://api.github.com/repos/slick/slick/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slick/slick/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slick/slick/git/refs{/sha}","trees_url":"https://api.github.com/repos/slick/slick/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slick/slick/statuses/{sha}","languages_url":"https://api.github.com/repos/slick/slick/languages","stargazers_url":"https://api.github.com/repos/slick/slick/stargazers","contributors_url":"https://api.github.com/repos/slick/slick/contributors","subscribers_url":"https://api.github.com/repos/slick/slick/subscribers","subscription_url":"https://api.github.com/repos/slick/slick/subscription","commits_url":"https://api.github.com/repos/slick/slick/commits{/sha}","git_commits_url":"https://api.github.com/repos/slick/slick/git/commits{/sha}","comments_url":"https://api.github.com/repos/slick/slick/comments{/number}","issue_comment_url":"https://api.github.com/repos/slick/slick/issues/comments{/number}","contents_url":"https://api.github.com/repos/slick/slick/contents/{+path}","compare_url":"https://api.github.com/repos/slick/slick/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slick/slick/merges","archive_url":"https://api.github.com/repos/slick/slick/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slick/slick/downloads","issues_url":"https://api.github.com/repos/slick/slick/issues{/number}","pulls_url":"https://api.github.com/repos/slick/slick/pulls{/number}","milestones_url":"https://api.github.com/repos/slick/slick/milestones{/number}","notifications_url":"https://api.github.com/repos/slick/slick/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slick/slick/labels{/name}","releases_url":"https://api.github.com/repos/slick/slick/releases{/id}","deployments_url":"https://api.github.com/repos/slick/slick/deployments","created_at":"2009-02-20T22:51:53Z","updated_at":"2018-03-01T14:16:44Z","pushed_at":"2018-03-01T09:46:28Z","git_url":"git://github.com/slick/slick.git","ssh_url":"git@github.com:slick/slick.git","clone_url":"https://github.com/slick/slick.git","svn_url":"https://github.com/slick/slick","homepage":"http://slick.lightbend.com","size":10014,"stargazers_count":1986,"watchers_count":1986,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":465,"mirror_url":null,"archived":false,"open_issues_count":432,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":465,"open_issues":432,"watchers":1986,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slick/slick/pulls/1854"},"html":{"href":"https://github.com/slick/slick/pull/1854"},"issue":{"href":"https://api.github.com/repos/slick/slick/issues/1854"},"comments":{"href":"https://api.github.com/repos/slick/slick/issues/1854/comments"},"review_comments":{"href":"https://api.github.com/repos/slick/slick/pulls/1854/comments"},"review_comment":{"href":"https://api.github.com/repos/slick/slick/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/slick/slick/pulls/1854/commits"},"statuses":{"href":"https://api.github.com/repos/slick/slick/statuses/77c974870663e97a083b3740103842fb0f087fa5"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"kwark"}}