{"action":"created","comment":{"url":"https://api.github.com/repos/yahoo/pulsar/pulls/comments/86057283","pull_request_review_id":6735020,"id":86057283,"diff_hunk":"@@ -88,7 +90,7 @@ public void start(PulsarClientImpl client, ConsumerBase consumerBase, long ackTi\n             public void run(Timeout t) throws Exception {\n                 if (isAckTimeout()) {\n                     log.warn(\"[{}] {} messages have timed-out\", consumerBase, oldOpenSet.size());\n-                    List<MessageIdImpl> messageIds = new ArrayList<>();\n+                    Set<MessageIdImpl> messageIds = new HashSet<>();","path":"pulsar-client/src/main/java/com/yahoo/pulsar/client/impl/UnAckedMessageTracker.java","position":15,"original_position":15,"commit_id":"af6d5bb49bafa1fbfe84e73858a2befb8c516bca","original_commit_id":"af6d5bb49bafa1fbfe84e73858a2befb8c516bca","user":{"login":"sschepens","id":3072509,"avatar_url":"https://avatars.githubusercontent.com/u/3072509?v=3","gravatar_id":"","url":"https://api.github.com/users/sschepens","html_url":"https://github.com/sschepens","followers_url":"https://api.github.com/users/sschepens/followers","following_url":"https://api.github.com/users/sschepens/following{/other_user}","gists_url":"https://api.github.com/users/sschepens/gists{/gist_id}","starred_url":"https://api.github.com/users/sschepens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschepens/subscriptions","organizations_url":"https://api.github.com/users/sschepens/orgs","repos_url":"https://api.github.com/users/sschepens/repos","events_url":"https://api.github.com/users/sschepens/events{/privacy}","received_events_url":"https://api.github.com/users/sschepens/received_events","type":"User","site_admin":false},"body":"Messages already come from a HashSet, UnAckedTracker keeps sets of messages.\r\nConverting them to Lists seems sort of a waste.","created_at":"2016-11-02T01:02:22Z","updated_at":"2016-11-02T01:02:22Z","html_url":"https://github.com/yahoo/pulsar/pull/101#discussion_r86057283","pull_request_url":"https://api.github.com/repos/yahoo/pulsar/pulls/101","_links":{"self":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/comments/86057283"},"html":{"href":"https://github.com/yahoo/pulsar/pull/101#discussion_r86057283"},"pull_request":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/101"}}},"pull_request":{"url":"https://api.github.com/repos/yahoo/pulsar/pulls/101","id":91864192,"html_url":"https://github.com/yahoo/pulsar/pull/101","diff_url":"https://github.com/yahoo/pulsar/pull/101.diff","patch_url":"https://github.com/yahoo/pulsar/pull/101.patch","issue_url":"https://api.github.com/repos/yahoo/pulsar/issues/101","number":101,"state":"open","locked":false,"title":"Increment permits when redelivering messages from incomingMessages","user":{"login":"sschepens","id":3072509,"avatar_url":"https://avatars.githubusercontent.com/u/3072509?v=3","gravatar_id":"","url":"https://api.github.com/users/sschepens","html_url":"https://github.com/sschepens","followers_url":"https://api.github.com/users/sschepens/followers","following_url":"https://api.github.com/users/sschepens/following{/other_user}","gists_url":"https://api.github.com/users/sschepens/gists{/gist_id}","starred_url":"https://api.github.com/users/sschepens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschepens/subscriptions","organizations_url":"https://api.github.com/users/sschepens/orgs","repos_url":"https://api.github.com/users/sschepens/repos","events_url":"https://api.github.com/users/sschepens/events{/privacy}","received_events_url":"https://api.github.com/users/sschepens/received_events","type":"User","site_admin":false},"body":"### Motivation\r\n\r\nIssue [#100](https://github.com/yahoo/pulsar/issues/100)\r\n\r\n### Modifications\r\n\r\n- Converted `redeliverUnacknowledgedMessages(List<MessageIdImpl> messageIds)` to receive a `Set` to allow for fast lookup.\r\n- Make `redeliverUnacknowledgedMessages(Set<MessageIdImpl> messageIds)` iterate, remove and count messages which are expired and still belong to the queue. Increase available permits by the amount of messages removed from the queue.\r\n__I'm not particularly certain about this, removing messages from a `BlockingQueue` is not recommended, but I don't really see a better way without changing much.__\r\n\r\n- Reset `unAckedMessageTracker` timer for messages that are retreived from the queue. Conceptually `ackTimeout` should be the maximum amount of time a consumer should be processing a message without acknowledging it, currently, the consumer has `ackTimeout - timeInQueue`, but the time the message is in the queue cannot be controlled, and a consumer could be handed a messsage which only has a few milliseconds remaining. We should reset the timer when pulling a message.\r\n\r\n\r\n","created_at":"2016-11-01T21:10:34Z","updated_at":"2016-11-02T01:02:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46afad211474a8869ed4ae97e9202a23f4f8d15f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/yahoo/pulsar/pulls/101/commits","review_comments_url":"https://api.github.com/repos/yahoo/pulsar/pulls/101/comments","review_comment_url":"https://api.github.com/repos/yahoo/pulsar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yahoo/pulsar/issues/101/comments","statuses_url":"https://api.github.com/repos/yahoo/pulsar/statuses/af6d5bb49bafa1fbfe84e73858a2befb8c516bca","head":{"label":"sschepens:increment_permits_on_queue_redelivery","ref":"increment_permits_on_queue_redelivery","sha":"af6d5bb49bafa1fbfe84e73858a2befb8c516bca","user":{"login":"sschepens","id":3072509,"avatar_url":"https://avatars.githubusercontent.com/u/3072509?v=3","gravatar_id":"","url":"https://api.github.com/users/sschepens","html_url":"https://github.com/sschepens","followers_url":"https://api.github.com/users/sschepens/followers","following_url":"https://api.github.com/users/sschepens/following{/other_user}","gists_url":"https://api.github.com/users/sschepens/gists{/gist_id}","starred_url":"https://api.github.com/users/sschepens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschepens/subscriptions","organizations_url":"https://api.github.com/users/sschepens/orgs","repos_url":"https://api.github.com/users/sschepens/repos","events_url":"https://api.github.com/users/sschepens/events{/privacy}","received_events_url":"https://api.github.com/users/sschepens/received_events","type":"User","site_admin":false},"repo":{"id":70098520,"name":"pulsar","full_name":"sschepens/pulsar","owner":{"login":"sschepens","id":3072509,"avatar_url":"https://avatars.githubusercontent.com/u/3072509?v=3","gravatar_id":"","url":"https://api.github.com/users/sschepens","html_url":"https://github.com/sschepens","followers_url":"https://api.github.com/users/sschepens/followers","following_url":"https://api.github.com/users/sschepens/following{/other_user}","gists_url":"https://api.github.com/users/sschepens/gists{/gist_id}","starred_url":"https://api.github.com/users/sschepens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschepens/subscriptions","organizations_url":"https://api.github.com/users/sschepens/orgs","repos_url":"https://api.github.com/users/sschepens/repos","events_url":"https://api.github.com/users/sschepens/events{/privacy}","received_events_url":"https://api.github.com/users/sschepens/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sschepens/pulsar","description":"Pulsar - distributed pub-sub messaging system","fork":true,"url":"https://api.github.com/repos/sschepens/pulsar","forks_url":"https://api.github.com/repos/sschepens/pulsar/forks","keys_url":"https://api.github.com/repos/sschepens/pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sschepens/pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sschepens/pulsar/teams","hooks_url":"https://api.github.com/repos/sschepens/pulsar/hooks","issue_events_url":"https://api.github.com/repos/sschepens/pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/sschepens/pulsar/events","assignees_url":"https://api.github.com/repos/sschepens/pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/sschepens/pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/sschepens/pulsar/tags","blobs_url":"https://api.github.com/repos/sschepens/pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sschepens/pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sschepens/pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/sschepens/pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sschepens/pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/sschepens/pulsar/languages","stargazers_url":"https://api.github.com/repos/sschepens/pulsar/stargazers","contributors_url":"https://api.github.com/repos/sschepens/pulsar/contributors","subscribers_url":"https://api.github.com/repos/sschepens/pulsar/subscribers","subscription_url":"https://api.github.com/repos/sschepens/pulsar/subscription","commits_url":"https://api.github.com/repos/sschepens/pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/sschepens/pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/sschepens/pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/sschepens/pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/sschepens/pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/sschepens/pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sschepens/pulsar/merges","archive_url":"https://api.github.com/repos/sschepens/pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sschepens/pulsar/downloads","issues_url":"https://api.github.com/repos/sschepens/pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/sschepens/pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/sschepens/pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/sschepens/pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sschepens/pulsar/labels{/name}","releases_url":"https://api.github.com/repos/sschepens/pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/sschepens/pulsar/deployments","created_at":"2016-10-05T20:52:50Z","updated_at":"2016-10-05T20:52:52Z","pushed_at":"2016-11-01T21:11:31Z","git_url":"git://github.com/sschepens/pulsar.git","ssh_url":"git@github.com:sschepens/pulsar.git","clone_url":"https://github.com/sschepens/pulsar.git","svn_url":"https://github.com/sschepens/pulsar","homepage":"","size":1825,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"yahoo:master","ref":"master","sha":"1f053681e6f2a5b5200b1fb9222bd794b786841f","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":62117812,"name":"pulsar","full_name":"yahoo/pulsar","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/pulsar","description":"Pulsar - distributed pub-sub messaging system","fork":false,"url":"https://api.github.com/repos/yahoo/pulsar","forks_url":"https://api.github.com/repos/yahoo/pulsar/forks","keys_url":"https://api.github.com/repos/yahoo/pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/pulsar/teams","hooks_url":"https://api.github.com/repos/yahoo/pulsar/hooks","issue_events_url":"https://api.github.com/repos/yahoo/pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/pulsar/events","assignees_url":"https://api.github.com/repos/yahoo/pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/pulsar/tags","blobs_url":"https://api.github.com/repos/yahoo/pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/pulsar/languages","stargazers_url":"https://api.github.com/repos/yahoo/pulsar/stargazers","contributors_url":"https://api.github.com/repos/yahoo/pulsar/contributors","subscribers_url":"https://api.github.com/repos/yahoo/pulsar/subscribers","subscription_url":"https://api.github.com/repos/yahoo/pulsar/subscription","commits_url":"https://api.github.com/repos/yahoo/pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/pulsar/merges","archive_url":"https://api.github.com/repos/yahoo/pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/pulsar/downloads","issues_url":"https://api.github.com/repos/yahoo/pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/pulsar/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/yahoo/pulsar/deployments","created_at":"2016-06-28T07:00:03Z","updated_at":"2016-11-02T00:43:02Z","pushed_at":"2016-11-01T21:11:31Z","git_url":"git://github.com/yahoo/pulsar.git","ssh_url":"git@github.com:yahoo/pulsar.git","clone_url":"https://github.com/yahoo/pulsar.git","svn_url":"https://github.com/yahoo/pulsar","homepage":"","size":1993,"stargazers_count":1036,"watchers_count":1036,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":199,"mirror_url":null,"open_issues_count":16,"forks":199,"open_issues":16,"watchers":1036,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/101"},"html":{"href":"https://github.com/yahoo/pulsar/pull/101"},"issue":{"href":"https://api.github.com/repos/yahoo/pulsar/issues/101"},"comments":{"href":"https://api.github.com/repos/yahoo/pulsar/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/yahoo/pulsar/statuses/af6d5bb49bafa1fbfe84e73858a2befb8c516bca"}}}}
{"actor":{"display_login":"sschepens"}}