{"action":"created","comment":{"url":"https://api.github.com/repos/flipkart-incubator/flux/pulls/comments/87832659","pull_request_review_id":8427967,"id":87832659,"diff_hunk":"@@ -68,17 +67,12 @@ public void addMessage(ScheduledMessage scheduledMessage) {\n     }\n \n     public void removeMessage(Long taskId) {\n-        final Optional<ScheduledMessage> scheduledMessageOptional\n-                = this.messages.stream().filter((m) -> m.getTaskId().equals(taskId)).findFirst();\n-        if (scheduledMessageOptional.isPresent()) {\n-            final ScheduledMessage message = scheduledMessageOptional.get();\n-            /* It is important that we delete from priority queue first. Its okay even if we the schedule for removal call fails.\n-                At most we will send a message that was not supposed to be sent but the receiver should be able to handle\n-                such cases by consulting its own DB.\n-             */\n-            this.messages.remove(message);\n-            this.messageManagerService.scheduleForRemoval(message);\n-        }\n+        /* It is important that we delete from priority queue first. Its okay even if we the schedule for removal call fails.\n+            At most we will send a message that was not supposed to be sent but the receiver should be able to handle\n+            such cases by consulting its own DB.\n+        */\n+        this.messages.removeIf((m) -> m.getTaskId().equals(taskId));","path":"redriver/src/main/java/com/flipkart/flux/redriver/scheduler/MessageScheduler.java","position":27,"original_position":27,"commit_id":"cb0fbf679d4a4336843dbae3a3c7f6536e0de5e2","original_commit_id":"cb0fbf679d4a4336843dbae3a3c7f6536e0de5e2","user":{"login":"gauravAshok","id":10920448,"avatar_url":"https://avatars.githubusercontent.com/u/10920448?v=3","gravatar_id":"","url":"https://api.github.com/users/gauravAshok","html_url":"https://github.com/gauravAshok","followers_url":"https://api.github.com/users/gauravAshok/followers","following_url":"https://api.github.com/users/gauravAshok/following{/other_user}","gists_url":"https://api.github.com/users/gauravAshok/gists{/gist_id}","starred_url":"https://api.github.com/users/gauravAshok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gauravAshok/subscriptions","organizations_url":"https://api.github.com/users/gauravAshok/orgs","repos_url":"https://api.github.com/users/gauravAshok/repos","events_url":"https://api.github.com/users/gauravAshok/events{/privacy}","received_events_url":"https://api.github.com/users/gauravAshok/received_events","type":"User","site_admin":false},"body":"Hey, can we use linkedHashSet instead of PriorityQueue. If tasks are registered roughly in the order of their executionTime then the task with the earliest execTime should be at the front of linkedList.\r\n","created_at":"2016-11-14T16:11:15Z","updated_at":"2016-11-14T16:11:15Z","html_url":"https://github.com/flipkart-incubator/flux/pull/41#discussion_r87832659","pull_request_url":"https://api.github.com/repos/flipkart-incubator/flux/pulls/41","_links":{"self":{"href":"https://api.github.com/repos/flipkart-incubator/flux/pulls/comments/87832659"},"html":{"href":"https://github.com/flipkart-incubator/flux/pull/41#discussion_r87832659"},"pull_request":{"href":"https://api.github.com/repos/flipkart-incubator/flux/pulls/41"}}},"pull_request":{"url":"https://api.github.com/repos/flipkart-incubator/flux/pulls/41","id":93568063,"html_url":"https://github.com/flipkart-incubator/flux/pull/41","diff_url":"https://github.com/flipkart-incubator/flux/pull/41.diff","patch_url":"https://github.com/flipkart-incubator/flux/pull/41.patch","issue_url":"https://api.github.com/repos/flipkart-incubator/flux/issues/41","number":41,"state":"open","locked":false,"title":"Leave akka cluster in shutdown hook","user":{"login":"shyamakirala","id":13641262,"avatar_url":"https://avatars.githubusercontent.com/u/13641262?v=3","gravatar_id":"","url":"https://api.github.com/users/shyamakirala","html_url":"https://github.com/shyamakirala","followers_url":"https://api.github.com/users/shyamakirala/followers","following_url":"https://api.github.com/users/shyamakirala/following{/other_user}","gists_url":"https://api.github.com/users/shyamakirala/gists{/gist_id}","starred_url":"https://api.github.com/users/shyamakirala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shyamakirala/subscriptions","organizations_url":"https://api.github.com/users/shyamakirala/orgs","repos_url":"https://api.github.com/users/shyamakirala/repos","events_url":"https://api.github.com/users/shyamakirala/events{/privacy}","received_events_url":"https://api.github.com/users/shyamakirala/received_events","type":"User","site_admin":false},"body":"1. Send cluster leave message from shutdown hook\r\n2. Changes to redriver delete logic","created_at":"2016-11-14T13:41:15Z","updated_at":"2016-11-14T16:11:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82224f55b7d5b0cf4779245d174641528218bb1d","assignee":{"login":"gauravAshok","id":10920448,"avatar_url":"https://avatars.githubusercontent.com/u/10920448?v=3","gravatar_id":"","url":"https://api.github.com/users/gauravAshok","html_url":"https://github.com/gauravAshok","followers_url":"https://api.github.com/users/gauravAshok/followers","following_url":"https://api.github.com/users/gauravAshok/following{/other_user}","gists_url":"https://api.github.com/users/gauravAshok/gists{/gist_id}","starred_url":"https://api.github.com/users/gauravAshok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gauravAshok/subscriptions","organizations_url":"https://api.github.com/users/gauravAshok/orgs","repos_url":"https://api.github.com/users/gauravAshok/repos","events_url":"https://api.github.com/users/gauravAshok/events{/privacy}","received_events_url":"https://api.github.com/users/gauravAshok/received_events","type":"User","site_admin":false},"assignees":[{"login":"gauravAshok","id":10920448,"avatar_url":"https://avatars.githubusercontent.com/u/10920448?v=3","gravatar_id":"","url":"https://api.github.com/users/gauravAshok","html_url":"https://github.com/gauravAshok","followers_url":"https://api.github.com/users/gauravAshok/followers","following_url":"https://api.github.com/users/gauravAshok/following{/other_user}","gists_url":"https://api.github.com/users/gauravAshok/gists{/gist_id}","starred_url":"https://api.github.com/users/gauravAshok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gauravAshok/subscriptions","organizations_url":"https://api.github.com/users/gauravAshok/orgs","repos_url":"https://api.github.com/users/gauravAshok/repos","events_url":"https://api.github.com/users/gauravAshok/events{/privacy}","received_events_url":"https://api.github.com/users/gauravAshok/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/flipkart-incubator/flux/pulls/41/commits","review_comments_url":"https://api.github.com/repos/flipkart-incubator/flux/pulls/41/comments","review_comment_url":"https://api.github.com/repos/flipkart-incubator/flux/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flipkart-incubator/flux/issues/41/comments","statuses_url":"https://api.github.com/repos/flipkart-incubator/flux/statuses/cb0fbf679d4a4336843dbae3a3c7f6536e0de5e2","head":{"label":"flipkart-incubator:multiple_fixes","ref":"multiple_fixes","sha":"cb0fbf679d4a4336843dbae3a3c7f6536e0de5e2","user":{"login":"flipkart-incubator","id":7090545,"avatar_url":"https://avatars.githubusercontent.com/u/7090545?v=3","gravatar_id":"","url":"https://api.github.com/users/flipkart-incubator","html_url":"https://github.com/flipkart-incubator","followers_url":"https://api.github.com/users/flipkart-incubator/followers","following_url":"https://api.github.com/users/flipkart-incubator/following{/other_user}","gists_url":"https://api.github.com/users/flipkart-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/flipkart-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flipkart-incubator/subscriptions","organizations_url":"https://api.github.com/users/flipkart-incubator/orgs","repos_url":"https://api.github.com/users/flipkart-incubator/repos","events_url":"https://api.github.com/users/flipkart-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/flipkart-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":51074108,"name":"flux","full_name":"flipkart-incubator/flux","owner":{"login":"flipkart-incubator","id":7090545,"avatar_url":"https://avatars.githubusercontent.com/u/7090545?v=3","gravatar_id":"","url":"https://api.github.com/users/flipkart-incubator","html_url":"https://github.com/flipkart-incubator","followers_url":"https://api.github.com/users/flipkart-incubator/followers","following_url":"https://api.github.com/users/flipkart-incubator/following{/other_user}","gists_url":"https://api.github.com/users/flipkart-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/flipkart-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flipkart-incubator/subscriptions","organizations_url":"https://api.github.com/users/flipkart-incubator/orgs","repos_url":"https://api.github.com/users/flipkart-incubator/repos","events_url":"https://api.github.com/users/flipkart-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/flipkart-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flipkart-incubator/flux","description":"Highly scalable Event-driven, Reactive system for building Stateful apps and Workflow services.","fork":false,"url":"https://api.github.com/repos/flipkart-incubator/flux","forks_url":"https://api.github.com/repos/flipkart-incubator/flux/forks","keys_url":"https://api.github.com/repos/flipkart-incubator/flux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flipkart-incubator/flux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flipkart-incubator/flux/teams","hooks_url":"https://api.github.com/repos/flipkart-incubator/flux/hooks","issue_events_url":"https://api.github.com/repos/flipkart-incubator/flux/issues/events{/number}","events_url":"https://api.github.com/repos/flipkart-incubator/flux/events","assignees_url":"https://api.github.com/repos/flipkart-incubator/flux/assignees{/user}","branches_url":"https://api.github.com/repos/flipkart-incubator/flux/branches{/branch}","tags_url":"https://api.github.com/repos/flipkart-incubator/flux/tags","blobs_url":"https://api.github.com/repos/flipkart-incubator/flux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flipkart-incubator/flux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flipkart-incubator/flux/git/refs{/sha}","trees_url":"https://api.github.com/repos/flipkart-incubator/flux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flipkart-incubator/flux/statuses/{sha}","languages_url":"https://api.github.com/repos/flipkart-incubator/flux/languages","stargazers_url":"https://api.github.com/repos/flipkart-incubator/flux/stargazers","contributors_url":"https://api.github.com/repos/flipkart-incubator/flux/contributors","subscribers_url":"https://api.github.com/repos/flipkart-incubator/flux/subscribers","subscription_url":"https://api.github.com/repos/flipkart-incubator/flux/subscription","commits_url":"https://api.github.com/repos/flipkart-incubator/flux/commits{/sha}","git_commits_url":"https://api.github.com/repos/flipkart-incubator/flux/git/commits{/sha}","comments_url":"https://api.github.com/repos/flipkart-incubator/flux/comments{/number}","issue_comment_url":"https://api.github.com/repos/flipkart-incubator/flux/issues/comments{/number}","contents_url":"https://api.github.com/repos/flipkart-incubator/flux/contents/{+path}","compare_url":"https://api.github.com/repos/flipkart-incubator/flux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flipkart-incubator/flux/merges","archive_url":"https://api.github.com/repos/flipkart-incubator/flux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flipkart-incubator/flux/downloads","issues_url":"https://api.github.com/repos/flipkart-incubator/flux/issues{/number}","pulls_url":"https://api.github.com/repos/flipkart-incubator/flux/pulls{/number}","milestones_url":"https://api.github.com/repos/flipkart-incubator/flux/milestones{/number}","notifications_url":"https://api.github.com/repos/flipkart-incubator/flux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flipkart-incubator/flux/labels{/name}","releases_url":"https://api.github.com/repos/flipkart-incubator/flux/releases{/id}","deployments_url":"https://api.github.com/repos/flipkart-incubator/flux/deployments","created_at":"2016-02-04T12:18:14Z","updated_at":"2016-11-12T08:09:50Z","pushed_at":"2016-11-14T16:01:40Z","git_url":"git://github.com/flipkart-incubator/flux.git","ssh_url":"git@github.com:flipkart-incubator/flux.git","clone_url":"https://github.com/flipkart-incubator/flux.git","svn_url":"https://github.com/flipkart-incubator/flux","homepage":"","size":4299,"stargazers_count":17,"watchers_count":17,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":3,"forks":16,"open_issues":3,"watchers":17,"default_branch":"master"}},"base":{"label":"flipkart-incubator:master","ref":"master","sha":"a0730e7a0d547bbec82e2d804fcaafd72224f4c9","user":{"login":"flipkart-incubator","id":7090545,"avatar_url":"https://avatars.githubusercontent.com/u/7090545?v=3","gravatar_id":"","url":"https://api.github.com/users/flipkart-incubator","html_url":"https://github.com/flipkart-incubator","followers_url":"https://api.github.com/users/flipkart-incubator/followers","following_url":"https://api.github.com/users/flipkart-incubator/following{/other_user}","gists_url":"https://api.github.com/users/flipkart-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/flipkart-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flipkart-incubator/subscriptions","organizations_url":"https://api.github.com/users/flipkart-incubator/orgs","repos_url":"https://api.github.com/users/flipkart-incubator/repos","events_url":"https://api.github.com/users/flipkart-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/flipkart-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":51074108,"name":"flux","full_name":"flipkart-incubator/flux","owner":{"login":"flipkart-incubator","id":7090545,"avatar_url":"https://avatars.githubusercontent.com/u/7090545?v=3","gravatar_id":"","url":"https://api.github.com/users/flipkart-incubator","html_url":"https://github.com/flipkart-incubator","followers_url":"https://api.github.com/users/flipkart-incubator/followers","following_url":"https://api.github.com/users/flipkart-incubator/following{/other_user}","gists_url":"https://api.github.com/users/flipkart-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/flipkart-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flipkart-incubator/subscriptions","organizations_url":"https://api.github.com/users/flipkart-incubator/orgs","repos_url":"https://api.github.com/users/flipkart-incubator/repos","events_url":"https://api.github.com/users/flipkart-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/flipkart-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flipkart-incubator/flux","description":"Highly scalable Event-driven, Reactive system for building Stateful apps and Workflow services.","fork":false,"url":"https://api.github.com/repos/flipkart-incubator/flux","forks_url":"https://api.github.com/repos/flipkart-incubator/flux/forks","keys_url":"https://api.github.com/repos/flipkart-incubator/flux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flipkart-incubator/flux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flipkart-incubator/flux/teams","hooks_url":"https://api.github.com/repos/flipkart-incubator/flux/hooks","issue_events_url":"https://api.github.com/repos/flipkart-incubator/flux/issues/events{/number}","events_url":"https://api.github.com/repos/flipkart-incubator/flux/events","assignees_url":"https://api.github.com/repos/flipkart-incubator/flux/assignees{/user}","branches_url":"https://api.github.com/repos/flipkart-incubator/flux/branches{/branch}","tags_url":"https://api.github.com/repos/flipkart-incubator/flux/tags","blobs_url":"https://api.github.com/repos/flipkart-incubator/flux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flipkart-incubator/flux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flipkart-incubator/flux/git/refs{/sha}","trees_url":"https://api.github.com/repos/flipkart-incubator/flux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flipkart-incubator/flux/statuses/{sha}","languages_url":"https://api.github.com/repos/flipkart-incubator/flux/languages","stargazers_url":"https://api.github.com/repos/flipkart-incubator/flux/stargazers","contributors_url":"https://api.github.com/repos/flipkart-incubator/flux/contributors","subscribers_url":"https://api.github.com/repos/flipkart-incubator/flux/subscribers","subscription_url":"https://api.github.com/repos/flipkart-incubator/flux/subscription","commits_url":"https://api.github.com/repos/flipkart-incubator/flux/commits{/sha}","git_commits_url":"https://api.github.com/repos/flipkart-incubator/flux/git/commits{/sha}","comments_url":"https://api.github.com/repos/flipkart-incubator/flux/comments{/number}","issue_comment_url":"https://api.github.com/repos/flipkart-incubator/flux/issues/comments{/number}","contents_url":"https://api.github.com/repos/flipkart-incubator/flux/contents/{+path}","compare_url":"https://api.github.com/repos/flipkart-incubator/flux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flipkart-incubator/flux/merges","archive_url":"https://api.github.com/repos/flipkart-incubator/flux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flipkart-incubator/flux/downloads","issues_url":"https://api.github.com/repos/flipkart-incubator/flux/issues{/number}","pulls_url":"https://api.github.com/repos/flipkart-incubator/flux/pulls{/number}","milestones_url":"https://api.github.com/repos/flipkart-incubator/flux/milestones{/number}","notifications_url":"https://api.github.com/repos/flipkart-incubator/flux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flipkart-incubator/flux/labels{/name}","releases_url":"https://api.github.com/repos/flipkart-incubator/flux/releases{/id}","deployments_url":"https://api.github.com/repos/flipkart-incubator/flux/deployments","created_at":"2016-02-04T12:18:14Z","updated_at":"2016-11-12T08:09:50Z","pushed_at":"2016-11-14T16:01:40Z","git_url":"git://github.com/flipkart-incubator/flux.git","ssh_url":"git@github.com:flipkart-incubator/flux.git","clone_url":"https://github.com/flipkart-incubator/flux.git","svn_url":"https://github.com/flipkart-incubator/flux","homepage":"","size":4299,"stargazers_count":17,"watchers_count":17,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":3,"forks":16,"open_issues":3,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flipkart-incubator/flux/pulls/41"},"html":{"href":"https://github.com/flipkart-incubator/flux/pull/41"},"issue":{"href":"https://api.github.com/repos/flipkart-incubator/flux/issues/41"},"comments":{"href":"https://api.github.com/repos/flipkart-incubator/flux/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/flipkart-incubator/flux/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/flipkart-incubator/flux/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flipkart-incubator/flux/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/flipkart-incubator/flux/statuses/cb0fbf679d4a4336843dbae3a3c7f6536e0de5e2"}}}}
{"actor":{"display_login":"gauravAshok"}}