{"action":"created","comment":{"url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/24413798","id":24413798,"diff_hunk":"@@ -161,6 +168,39 @@ public int compareTo(PrioritizedRunnable pr) {\n             }\n             return insertionOrder < ((TieBreakingPrioritizedRunnable) pr).insertionOrder ? -1 : 1;\n         }\n+\n+        public void scheduleTimeout(ScheduledExecutorService timer, final Runnable timeoutCallback, TimeValue timeValue) {\n+            this.timeoutCallback = timeoutCallback;\n+            synchronized (this) {\n+                timeoutFuture = timer.schedule(new Runnable() {","path":"src/main/java/org/elasticsearch/common/util/concurrent/PrioritizedEsThreadPoolExecutor.java","position":68,"original_position":68,"commit_id":"f063582ca07d8116e232c61accde0874fe5adb36","original_commit_id":"f063582ca07d8116e232c61accde0874fe5adb36","user":{"login":"imotov","id":655851,"avatar_url":"https://avatars.githubusercontent.com/u/655851?v=3","gravatar_id":"","url":"https://api.github.com/users/imotov","html_url":"https://github.com/imotov","followers_url":"https://api.github.com/users/imotov/followers","following_url":"https://api.github.com/users/imotov/following{/other_user}","gists_url":"https://api.github.com/users/imotov/gists{/gist_id}","starred_url":"https://api.github.com/users/imotov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imotov/subscriptions","organizations_url":"https://api.github.com/users/imotov/orgs","repos_url":"https://api.github.com/users/imotov/repos","events_url":"https://api.github.com/users/imotov/events{/privacy}","received_events_url":"https://api.github.com/users/imotov/received_events","type":"User","site_admin":false},"body":"Currently, that's not possible since we call scheduleTimout first and only upon its return we execute, but we can add the check for safety in case somebody will flip the order of things in future revisions. ","created_at":"2015-02-10T14:10:19Z","updated_at":"2015-02-10T14:10:19Z","html_url":"https://github.com/elasticsearch/elasticsearch/pull/9621#discussion_r24413798","pull_request_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/9621","_links":{"self":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/24413798"},"html":{"href":"https://github.com/elasticsearch/elasticsearch/pull/9621#discussion_r24413798"},"pull_request":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/9621"}}},"pull_request":{"url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/9621","id":28975768,"html_url":"https://github.com/elasticsearch/elasticsearch/pull/9621","diff_url":"https://github.com/elasticsearch/elasticsearch/pull/9621.diff","patch_url":"https://github.com/elasticsearch/elasticsearch/pull/9621.patch","issue_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/9621","number":9621,"state":"open","locked":false,"title":"Internal: promptly cleanup updateTask timeout handler","user":{"login":"imotov","id":655851,"avatar_url":"https://avatars.githubusercontent.com/u/655851?v=3","gravatar_id":"","url":"https://api.github.com/users/imotov","html_url":"https://github.com/imotov","followers_url":"https://api.github.com/users/imotov/followers","following_url":"https://api.github.com/users/imotov/following{/other_user}","gists_url":"https://api.github.com/users/imotov/gists{/gist_id}","starred_url":"https://api.github.com/users/imotov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imotov/subscriptions","organizations_url":"https://api.github.com/users/imotov/orgs","repos_url":"https://api.github.com/users/imotov/repos","events_url":"https://api.github.com/users/imotov/events{/privacy}","received_events_url":"https://api.github.com/users/imotov/received_events","type":"User","site_admin":false},"body":"Improve cleanup of updateTask timeout handlers. The timeout handlers should be removed as soon as a corresponding update task is processed. Otherwise, timeout handlers might keep old updateTasks and all objects that they are pointing to in memory for the duration of timeout (15 minutes by default).\r\n\r\nImplementing this for PrioritizedFutureTask is tricky. And since it's not used (nor tested), I am not sure if we should do it for the sake of completeness or it might be cleaner to just remove PrioritizedFutureTask altogether. Thoughts?","created_at":"2015-02-10T02:18:49Z","updated_at":"2015-02-10T14:10:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"efd5d581b05c54e1dba540777e6b67f4811195e9","assignee":{"login":"s1monw","id":973334,"avatar_url":"https://avatars.githubusercontent.com/u/973334?v=3","gravatar_id":"","url":"https://api.github.com/users/s1monw","html_url":"https://github.com/s1monw","followers_url":"https://api.github.com/users/s1monw/followers","following_url":"https://api.github.com/users/s1monw/following{/other_user}","gists_url":"https://api.github.com/users/s1monw/gists{/gist_id}","starred_url":"https://api.github.com/users/s1monw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s1monw/subscriptions","organizations_url":"https://api.github.com/users/s1monw/orgs","repos_url":"https://api.github.com/users/s1monw/repos","events_url":"https://api.github.com/users/s1monw/events{/privacy}","received_events_url":"https://api.github.com/users/s1monw/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/9621/commits","review_comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/9621/comments","review_comment_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/{number}","comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/9621/comments","statuses_url":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/f063582ca07d8116e232c61accde0874fe5adb36","head":{"label":"imotov:fix-timeout-handling","ref":"fix-timeout-handling","sha":"f063582ca07d8116e232c61accde0874fe5adb36","user":{"login":"imotov","id":655851,"avatar_url":"https://avatars.githubusercontent.com/u/655851?v=3","gravatar_id":"","url":"https://api.github.com/users/imotov","html_url":"https://github.com/imotov","followers_url":"https://api.github.com/users/imotov/followers","following_url":"https://api.github.com/users/imotov/following{/other_user}","gists_url":"https://api.github.com/users/imotov/gists{/gist_id}","starred_url":"https://api.github.com/users/imotov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imotov/subscriptions","organizations_url":"https://api.github.com/users/imotov/orgs","repos_url":"https://api.github.com/users/imotov/repos","events_url":"https://api.github.com/users/imotov/events{/privacy}","received_events_url":"https://api.github.com/users/imotov/received_events","type":"User","site_admin":false},"repo":{"id":1484646,"name":"elasticsearch","full_name":"imotov/elasticsearch","owner":{"login":"imotov","id":655851,"avatar_url":"https://avatars.githubusercontent.com/u/655851?v=3","gravatar_id":"","url":"https://api.github.com/users/imotov","html_url":"https://github.com/imotov","followers_url":"https://api.github.com/users/imotov/followers","following_url":"https://api.github.com/users/imotov/following{/other_user}","gists_url":"https://api.github.com/users/imotov/gists{/gist_id}","starred_url":"https://api.github.com/users/imotov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imotov/subscriptions","organizations_url":"https://api.github.com/users/imotov/orgs","repos_url":"https://api.github.com/users/imotov/repos","events_url":"https://api.github.com/users/imotov/events{/privacy}","received_events_url":"https://api.github.com/users/imotov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imotov/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/imotov/elasticsearch","forks_url":"https://api.github.com/repos/imotov/elasticsearch/forks","keys_url":"https://api.github.com/repos/imotov/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imotov/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imotov/elasticsearch/teams","hooks_url":"https://api.github.com/repos/imotov/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/imotov/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/imotov/elasticsearch/events","assignees_url":"https://api.github.com/repos/imotov/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/imotov/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/imotov/elasticsearch/tags","blobs_url":"https://api.github.com/repos/imotov/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imotov/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imotov/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/imotov/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imotov/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/imotov/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/imotov/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/imotov/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/imotov/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/imotov/elasticsearch/subscription","commits_url":"https://api.github.com/repos/imotov/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/imotov/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/imotov/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/imotov/elasticsearch/issues/comments/{number}","contents_url":"https://api.github.com/repos/imotov/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/imotov/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imotov/elasticsearch/merges","archive_url":"https://api.github.com/repos/imotov/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imotov/elasticsearch/downloads","issues_url":"https://api.github.com/repos/imotov/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/imotov/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/imotov/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/imotov/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imotov/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/imotov/elasticsearch/releases{/id}","created_at":"2011-03-15T21:12:02Z","updated_at":"2014-06-19T21:59:06Z","pushed_at":"2015-02-10T02:04:46Z","git_url":"git://github.com/imotov/elasticsearch.git","ssh_url":"git@github.com:imotov/elasticsearch.git","clone_url":"https://github.com/imotov/elasticsearch.git","svn_url":"https://github.com/imotov/elasticsearch","homepage":"http://elasticsearch.org","size":75530,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"elasticsearch:master","ref":"master","sha":"c9893ba0c2ee8c703953fd45cb8e2bb668db5d49","user":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elasticsearch/elasticsearch","owner":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elasticsearch/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elasticsearch/elasticsearch","forks_url":"https://api.github.com/repos/elasticsearch/elasticsearch/forks","keys_url":"https://api.github.com/repos/elasticsearch/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elasticsearch/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elasticsearch/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elasticsearch/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elasticsearch/elasticsearch/events","assignees_url":"https://api.github.com/repos/elasticsearch/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elasticsearch/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elasticsearch/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elasticsearch/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elasticsearch/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elasticsearch/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elasticsearch/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elasticsearch/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/comments/{number}","contents_url":"https://api.github.com/repos/elasticsearch/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elasticsearch/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elasticsearch/elasticsearch/merges","archive_url":"https://api.github.com/repos/elasticsearch/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elasticsearch/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elasticsearch/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elasticsearch/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elasticsearch/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elasticsearch/elasticsearch/releases{/id}","created_at":"2010-02-08T13:20:56Z","updated_at":"2015-02-10T12:01:25Z","pushed_at":"2015-02-10T12:16:35Z","git_url":"git://github.com/elasticsearch/elasticsearch.git","ssh_url":"git@github.com:elasticsearch/elasticsearch.git","clone_url":"https://github.com/elasticsearch/elasticsearch.git","svn_url":"https://github.com/elasticsearch/elasticsearch","homepage":"http://elasticsearch.org","size":272694,"stargazers_count":9910,"watchers_count":9910,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3042,"mirror_url":null,"open_issues_count":948,"forks":3042,"open_issues":948,"watchers":9910,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/9621"},"html":{"href":"https://github.com/elasticsearch/elasticsearch/pull/9621"},"issue":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/9621"},"comments":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/9621/comments"},"review_comments":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/9621/comments"},"review_comment":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/9621/commits"},"statuses":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/f063582ca07d8116e232c61accde0874fe5adb36"}}}}