{"action":"created","issue":{"url":"https://api.github.com/repos/netty/netty/issues/5086","repository_url":"https://api.github.com/repos/netty/netty","labels_url":"https://api.github.com/repos/netty/netty/issues/5086/labels{/name}","comments_url":"https://api.github.com/repos/netty/netty/issues/5086/comments","events_url":"https://api.github.com/repos/netty/netty/issues/5086/events","html_url":"https://github.com/netty/netty/pull/5086","id":146181457,"number":5086,"title":"Explicit thread group on DefaultThreadFactory.","user":{"login":"zhangkun83","id":9053690,"avatar_url":"https://avatars.githubusercontent.com/u/9053690?v=3","gravatar_id":"","url":"https://api.github.com/users/zhangkun83","html_url":"https://github.com/zhangkun83","followers_url":"https://api.github.com/users/zhangkun83/followers","following_url":"https://api.github.com/users/zhangkun83/following{/other_user}","gists_url":"https://api.github.com/users/zhangkun83/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangkun83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangkun83/subscriptions","organizations_url":"https://api.github.com/users/zhangkun83/orgs","repos_url":"https://api.github.com/users/zhangkun83/repos","events_url":"https://api.github.com/users/zhangkun83/events{/privacy}","received_events_url":"https://api.github.com/users/zhangkun83/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/netty/netty/labels/defect","name":"defect","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/netty/netty/milestones/141","html_url":"https://github.com/netty/netty/milestones/4.0.37.Final","labels_url":"https://api.github.com/repos/netty/netty/milestones/141/labels","id":1682502,"number":141,"title":"4.0.37.Final","description":"","creator":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"open_issues":63,"closed_issues":9,"state":"open","created_at":"2016-04-04T16:35:57Z","updated_at":"2016-04-06T07:13:05Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-04-06T04:08:17Z","updated_at":"2016-04-06T07:16:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/netty/netty/pulls/5086","html_url":"https://github.com/netty/netty/pull/5086","diff_url":"https://github.com/netty/netty/pull/5086.diff","patch_url":"https://github.com/netty/netty/pull/5086.patch"},"body":"Motivation:\r\n\r\nFixes #5084. We (gRPC) encountered a bug that was triggered by\r\ngrpc/grpc-java@d927180. After that commit, event loop threads are\r\ncreated per task by NioEventLoopGroup, and inherits the thread group of\r\nthe caller, which in our case is an application-provided request-scope\r\nthread. Things go south when the application tries to manipulate (e.g.,\r\ninterrupt and join) all threads of the request-scope thread group, which\r\nunexpectedly include the event loop threads.\r\n\r\nModifications:\r\n\r\nDefaultThreadFactory will save the current thread group in constructor,\r\nand apply it to all new threads.\r\n\r\nResult:\r\n\r\nThreads created by DefaultThreadFactory will be in the same thread group\r\nas the thread where the factory is created."},"comment":{"url":"https://api.github.com/repos/netty/netty/issues/comments/206172322","html_url":"https://github.com/netty/netty/pull/5086#issuecomment-206172322","issue_url":"https://api.github.com/repos/netty/netty/issues/5086","id":206172322,"user":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"created_at":"2016-04-06T07:16:07Z","updated_at":"2016-04-06T07:16:07Z","body":"@zhangkun83 maybe as part of this could just use a new constructor that allows to pass a `ThreadGroup` in ? The old constructor would then just use `Thread.currentThread().getThreadGroup()` and delegate to the new constructor. "}}