{"action":"created","comment":{"url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/comments/203053039","pull_request_review_id":137866869,"id":203053039,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzA1MzAzOQ==","diff_hunk":"@@ -325,6 +339,10 @@ def execute_task(completion)\n     def timeout_task(completion)\n       return unless @running.true?\n       if completion.try?\n+        @executor.kill\n+        @executor.wait_for_termination\n+        @executor = Concurrent::RubySingleThreadExecutor.new()","path":"lib/concurrent/timer_task.rb","position":null,"original_position":46,"commit_id":"61e00742ca50d4890ebbbbfd97599c794d59fb41","original_commit_id":"5a65b7677c95ca6ba187fdac143239418e6049f3","user":{"login":"rubemz","id":151245,"node_id":"MDQ6VXNlcjE1MTI0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/151245?v=4","gravatar_id":"","url":"https://api.github.com/users/rubemz","html_url":"https://github.com/rubemz","followers_url":"https://api.github.com/users/rubemz/followers","following_url":"https://api.github.com/users/rubemz/following{/other_user}","gists_url":"https://api.github.com/users/rubemz/gists{/gist_id}","starred_url":"https://api.github.com/users/rubemz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubemz/subscriptions","organizations_url":"https://api.github.com/users/rubemz/orgs","repos_url":"https://api.github.com/users/rubemz/repos","events_url":"https://api.github.com/users/rubemz/events{/privacy}","received_events_url":"https://api.github.com/users/rubemz/received_events","type":"User","site_admin":false},"body":"61e0074","created_at":"2018-07-17T14:49:07Z","updated_at":"2018-07-17T14:49:08Z","html_url":"https://github.com/ruby-concurrency/concurrent-ruby/pull/749#discussion_r203053039","pull_request_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/749","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/comments/203053039"},"html":{"href":"https://github.com/ruby-concurrency/concurrent-ruby/pull/749#discussion_r203053039"},"pull_request":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/749"}},"in_reply_to_id":202424012},"pull_request":{"url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/749","id":201331547,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxMzMxNTQ3","html_url":"https://github.com/ruby-concurrency/concurrent-ruby/pull/749","diff_url":"https://github.com/ruby-concurrency/concurrent-ruby/pull/749.diff","patch_url":"https://github.com/ruby-concurrency/concurrent-ruby/pull/749.patch","issue_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/749","number":749,"state":"open","locked":false,"title":"TimerTask: kill the execution when it exceeds the task timeout ","user":{"login":"rubemz","id":151245,"node_id":"MDQ6VXNlcjE1MTI0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/151245?v=4","gravatar_id":"","url":"https://api.github.com/users/rubemz","html_url":"https://github.com/rubemz","followers_url":"https://api.github.com/users/rubemz/followers","following_url":"https://api.github.com/users/rubemz/following{/other_user}","gists_url":"https://api.github.com/users/rubemz/gists{/gist_id}","starred_url":"https://api.github.com/users/rubemz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubemz/subscriptions","organizations_url":"https://api.github.com/users/rubemz/orgs","repos_url":"https://api.github.com/users/rubemz/repos","events_url":"https://api.github.com/users/rubemz/events{/privacy}","received_events_url":"https://api.github.com/users/rubemz/received_events","type":"User","site_admin":false},"body":"Before this commit when a TimerTask task exceeded the timeout the job kept running. That could lead to thread leaking. Related to #639\r\n\r\nThis PR changes the TimerTask executor to be a SingleThreadExecutor. So whenever the task doesn't finish in time, the execution thread is killed (in this case the pool is killed).\r\n\r\nThe spec ensures that this new behavior is working correctly. It fails on master. If the main job isn't killed after the timeout, the `latch.wait(2)` would raise, since the timer task sleeps for 5 seconds.\r\n\r\nIf you want to see the leak by yourself take a look on this https://github.com/rubemz/concurrent-ruby-leak, which is pretty much a copy from https://github.com/ruby-concurrency/concurrent-ruby/issues/639#issuecomment-309792568. @shun0309 thanks for that code.\r\n\r\nCloses #639","created_at":"2018-07-13T15:51:56Z","updated_at":"2018-07-17T14:49:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21071138b9d99e58e2e6d3013d2ed9d695ca33f7","assignee":{"login":"rubemz","id":151245,"node_id":"MDQ6VXNlcjE1MTI0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/151245?v=4","gravatar_id":"","url":"https://api.github.com/users/rubemz","html_url":"https://github.com/rubemz","followers_url":"https://api.github.com/users/rubemz/followers","following_url":"https://api.github.com/users/rubemz/following{/other_user}","gists_url":"https://api.github.com/users/rubemz/gists{/gist_id}","starred_url":"https://api.github.com/users/rubemz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubemz/subscriptions","organizations_url":"https://api.github.com/users/rubemz/orgs","repos_url":"https://api.github.com/users/rubemz/repos","events_url":"https://api.github.com/users/rubemz/events{/privacy}","received_events_url":"https://api.github.com/users/rubemz/received_events","type":"User","site_admin":false},"assignees":[{"login":"rubemz","id":151245,"node_id":"MDQ6VXNlcjE1MTI0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/151245?v=4","gravatar_id":"","url":"https://api.github.com/users/rubemz","html_url":"https://github.com/rubemz","followers_url":"https://api.github.com/users/rubemz/followers","following_url":"https://api.github.com/users/rubemz/following{/other_user}","gists_url":"https://api.github.com/users/rubemz/gists{/gist_id}","starred_url":"https://api.github.com/users/rubemz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubemz/subscriptions","organizations_url":"https://api.github.com/users/rubemz/orgs","repos_url":"https://api.github.com/users/rubemz/repos","events_url":"https://api.github.com/users/rubemz/events{/privacy}","received_events_url":"https://api.github.com/users/rubemz/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"pitr-ch","id":204460,"node_id":"MDQ6VXNlcjIwNDQ2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/204460?v=4","gravatar_id":"","url":"https://api.github.com/users/pitr-ch","html_url":"https://github.com/pitr-ch","followers_url":"https://api.github.com/users/pitr-ch/followers","following_url":"https://api.github.com/users/pitr-ch/following{/other_user}","gists_url":"https://api.github.com/users/pitr-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/pitr-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitr-ch/subscriptions","organizations_url":"https://api.github.com/users/pitr-ch/orgs","repos_url":"https://api.github.com/users/pitr-ch/repos","events_url":"https://api.github.com/users/pitr-ch/events{/privacy}","received_events_url":"https://api.github.com/users/pitr-ch/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":147854198,"node_id":"MDU6TGFiZWwxNDc4NTQxOTg=","url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/labels/in%20progress","name":"in progress","color":"e6e6e6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/749/commits","review_comments_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/749/comments","review_comment_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/749/comments","statuses_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/statuses/61e00742ca50d4890ebbbbfd97599c794d59fb41","head":{"label":"rubemz:fix/timer-task-leaking","ref":"fix/timer-task-leaking","sha":"61e00742ca50d4890ebbbbfd97599c794d59fb41","user":{"login":"rubemz","id":151245,"node_id":"MDQ6VXNlcjE1MTI0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/151245?v=4","gravatar_id":"","url":"https://api.github.com/users/rubemz","html_url":"https://github.com/rubemz","followers_url":"https://api.github.com/users/rubemz/followers","following_url":"https://api.github.com/users/rubemz/following{/other_user}","gists_url":"https://api.github.com/users/rubemz/gists{/gist_id}","starred_url":"https://api.github.com/users/rubemz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubemz/subscriptions","organizations_url":"https://api.github.com/users/rubemz/orgs","repos_url":"https://api.github.com/users/rubemz/repos","events_url":"https://api.github.com/users/rubemz/events{/privacy}","received_events_url":"https://api.github.com/users/rubemz/received_events","type":"User","site_admin":false},"repo":{"id":140744747,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA3NDQ3NDc=","name":"concurrent-ruby","full_name":"rubemz/concurrent-ruby","owner":{"login":"rubemz","id":151245,"node_id":"MDQ6VXNlcjE1MTI0NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/151245?v=4","gravatar_id":"","url":"https://api.github.com/users/rubemz","html_url":"https://github.com/rubemz","followers_url":"https://api.github.com/users/rubemz/followers","following_url":"https://api.github.com/users/rubemz/following{/other_user}","gists_url":"https://api.github.com/users/rubemz/gists{/gist_id}","starred_url":"https://api.github.com/users/rubemz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubemz/subscriptions","organizations_url":"https://api.github.com/users/rubemz/orgs","repos_url":"https://api.github.com/users/rubemz/repos","events_url":"https://api.github.com/users/rubemz/events{/privacy}","received_events_url":"https://api.github.com/users/rubemz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rubemz/concurrent-ruby","description":"Modern concurrency tools including agents, futures, promises, thread pools, supervisors, and more. Inspired by Erlang, Clojure, Scala, Go, Java, JavaScript, and classic concurrency patterns.","fork":true,"url":"https://api.github.com/repos/rubemz/concurrent-ruby","forks_url":"https://api.github.com/repos/rubemz/concurrent-ruby/forks","keys_url":"https://api.github.com/repos/rubemz/concurrent-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubemz/concurrent-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubemz/concurrent-ruby/teams","hooks_url":"https://api.github.com/repos/rubemz/concurrent-ruby/hooks","issue_events_url":"https://api.github.com/repos/rubemz/concurrent-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/rubemz/concurrent-ruby/events","assignees_url":"https://api.github.com/repos/rubemz/concurrent-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/rubemz/concurrent-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/rubemz/concurrent-ruby/tags","blobs_url":"https://api.github.com/repos/rubemz/concurrent-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubemz/concurrent-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubemz/concurrent-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubemz/concurrent-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubemz/concurrent-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/rubemz/concurrent-ruby/languages","stargazers_url":"https://api.github.com/repos/rubemz/concurrent-ruby/stargazers","contributors_url":"https://api.github.com/repos/rubemz/concurrent-ruby/contributors","subscribers_url":"https://api.github.com/repos/rubemz/concurrent-ruby/subscribers","subscription_url":"https://api.github.com/repos/rubemz/concurrent-ruby/subscription","commits_url":"https://api.github.com/repos/rubemz/concurrent-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubemz/concurrent-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubemz/concurrent-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubemz/concurrent-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubemz/concurrent-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/rubemz/concurrent-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubemz/concurrent-ruby/merges","archive_url":"https://api.github.com/repos/rubemz/concurrent-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubemz/concurrent-ruby/downloads","issues_url":"https://api.github.com/repos/rubemz/concurrent-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/rubemz/concurrent-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/rubemz/concurrent-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/rubemz/concurrent-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubemz/concurrent-ruby/labels{/name}","releases_url":"https://api.github.com/repos/rubemz/concurrent-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/rubemz/concurrent-ruby/deployments","created_at":"2018-07-12T17:28:03Z","updated_at":"2018-07-12T17:28:06Z","pushed_at":"2018-07-17T14:48:11Z","git_url":"git://github.com/rubemz/concurrent-ruby.git","ssh_url":"git@github.com:rubemz/concurrent-ruby.git","clone_url":"https://github.com/rubemz/concurrent-ruby.git","svn_url":"https://github.com/rubemz/concurrent-ruby","homepage":"http://www.concurrent-ruby.com","size":11233,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ruby-concurrency:master","ref":"master","sha":"7821e0c0261abe4365f3f19a28b0400b2208d46c","user":{"login":"ruby-concurrency","id":5462766,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NjI3NjY=","avatar_url":"https://avatars3.githubusercontent.com/u/5462766?v=4","gravatar_id":"","url":"https://api.github.com/users/ruby-concurrency","html_url":"https://github.com/ruby-concurrency","followers_url":"https://api.github.com/users/ruby-concurrency/followers","following_url":"https://api.github.com/users/ruby-concurrency/following{/other_user}","gists_url":"https://api.github.com/users/ruby-concurrency/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-concurrency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-concurrency/subscriptions","organizations_url":"https://api.github.com/users/ruby-concurrency/orgs","repos_url":"https://api.github.com/users/ruby-concurrency/repos","events_url":"https://api.github.com/users/ruby-concurrency/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-concurrency/received_events","type":"Organization","site_admin":false},"repo":{"id":11607598,"node_id":"MDEwOlJlcG9zaXRvcnkxMTYwNzU5OA==","name":"concurrent-ruby","full_name":"ruby-concurrency/concurrent-ruby","owner":{"login":"ruby-concurrency","id":5462766,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NjI3NjY=","avatar_url":"https://avatars3.githubusercontent.com/u/5462766?v=4","gravatar_id":"","url":"https://api.github.com/users/ruby-concurrency","html_url":"https://github.com/ruby-concurrency","followers_url":"https://api.github.com/users/ruby-concurrency/followers","following_url":"https://api.github.com/users/ruby-concurrency/following{/other_user}","gists_url":"https://api.github.com/users/ruby-concurrency/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-concurrency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-concurrency/subscriptions","organizations_url":"https://api.github.com/users/ruby-concurrency/orgs","repos_url":"https://api.github.com/users/ruby-concurrency/repos","events_url":"https://api.github.com/users/ruby-concurrency/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-concurrency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ruby-concurrency/concurrent-ruby","description":"Modern concurrency tools including agents, futures, promises, thread pools, supervisors, and more. Inspired by Erlang, Clojure, Scala, Go, Java, JavaScript, and classic concurrency patterns.","fork":false,"url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby","forks_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/forks","keys_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/teams","hooks_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/hooks","issue_events_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/events","assignees_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/tags","blobs_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/languages","stargazers_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/stargazers","contributors_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/contributors","subscribers_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/subscribers","subscription_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/subscription","commits_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/merges","archive_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/downloads","issues_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/labels{/name}","releases_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/deployments","created_at":"2013-07-23T12:19:51Z","updated_at":"2018-07-16T12:30:23Z","pushed_at":"2018-07-17T14:48:13Z","git_url":"git://github.com/ruby-concurrency/concurrent-ruby.git","ssh_url":"git@github.com:ruby-concurrency/concurrent-ruby.git","clone_url":"https://github.com/ruby-concurrency/concurrent-ruby.git","svn_url":"https://github.com/ruby-concurrency/concurrent-ruby","homepage":"http://www.concurrent-ruby.com","size":11250,"stargazers_count":4208,"watchers_count":4208,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":246,"mirror_url":null,"archived":false,"open_issues_count":64,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":246,"open_issues":64,"watchers":4208,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/749"},"html":{"href":"https://github.com/ruby-concurrency/concurrent-ruby/pull/749"},"issue":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/749"},"comments":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/749/comments"},"review_comments":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/749/comments"},"review_comment":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/749/commits"},"statuses":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/statuses/61e00742ca50d4890ebbbbfd97599c794d59fb41"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"rubemz"}}