{"action":"created","issue":{"url":"https://api.github.com/repos/census-instrumentation/opencensus-python/issues/363","repository_url":"https://api.github.com/repos/census-instrumentation/opencensus-python","labels_url":"https://api.github.com/repos/census-instrumentation/opencensus-python/issues/363/labels{/name}","comments_url":"https://api.github.com/repos/census-instrumentation/opencensus-python/issues/363/comments","events_url":"https://api.github.com/repos/census-instrumentation/opencensus-python/issues/363/events","html_url":"https://github.com/census-instrumentation/opencensus-python/pull/363","id":374384893,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2MDk4OTYz","number":363,"title":"Thread pools integration","user":{"login":"geobeau","id":12186336,"node_id":"MDQ6VXNlcjEyMTg2MzM2","avatar_url":"https://avatars0.githubusercontent.com/u/12186336?v=4","gravatar_id":"","url":"https://api.github.com/users/geobeau","html_url":"https://github.com/geobeau","followers_url":"https://api.github.com/users/geobeau/followers","following_url":"https://api.github.com/users/geobeau/following{/other_user}","gists_url":"https://api.github.com/users/geobeau/gists{/gist_id}","starred_url":"https://api.github.com/users/geobeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geobeau/subscriptions","organizations_url":"https://api.github.com/users/geobeau/orgs","repos_url":"https://api.github.com/users/geobeau/repos","events_url":"https://api.github.com/users/geobeau/events{/privacy}","received_events_url":"https://api.github.com/users/geobeau/received_events","type":"User","site_admin":false},"labels":[{"id":997894239,"node_id":"MDU6TGFiZWw5OTc4OTQyMzk=","url":"https://api.github.com/repos/census-instrumentation/opencensus-python/labels/cla:%20yes","name":"cla: yes","color":"c0e07b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-26T13:30:27Z","updated_at":"2018-10-26T16:41:55Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/census-instrumentation/opencensus-python/pulls/363","html_url":"https://github.com/census-instrumentation/opencensus-python/pull/363","diff_url":"https://github.com/census-instrumentation/opencensus-python/pull/363.diff","patch_url":"https://github.com/census-instrumentation/opencensus-python/pull/363.patch"},"body":"Today, Opencensus wraps Threading, we propagate the current tracer to the child thread by wrapping Thread.run() and Thread.start() (https://github.com/python/cpython/blob/3.6/Lib/threading.py). \r\n\r\nUnfortunately it doesn't work well when we use a pool of reusable worker thread. Multiprocessing.Pool (https://github.com/python/cpython/blob/3.6/Lib/multiprocessing/pool.py) lazy create a pool of thread the first time we _init_ the Pool object, propagating its tracer to them. When it gets reused later by another request, the task sent to the workers is traced using the tracer from the original request breaking both of the trace.\r\n\r\nTo trace tasks sent to thread pool, we wrap apply_async() to wrap func and add the tracer in the args. futures.ThreadPoolExecutor is also tracer by wrapping submit()"},"comment":{"url":"https://api.github.com/repos/census-instrumentation/opencensus-python/issues/comments/433470411","html_url":"https://github.com/census-instrumentation/opencensus-python/pull/363#issuecomment-433470411","issue_url":"https://api.github.com/repos/census-instrumentation/opencensus-python/issues/363","id":433470411,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzQ3MDQxMQ==","user":{"login":"reyang","id":17327289,"node_id":"MDQ6VXNlcjE3MzI3Mjg5","avatar_url":"https://avatars1.githubusercontent.com/u/17327289?v=4","gravatar_id":"","url":"https://api.github.com/users/reyang","html_url":"https://github.com/reyang","followers_url":"https://api.github.com/users/reyang/followers","following_url":"https://api.github.com/users/reyang/following{/other_user}","gists_url":"https://api.github.com/users/reyang/gists{/gist_id}","starred_url":"https://api.github.com/users/reyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reyang/subscriptions","organizations_url":"https://api.github.com/users/reyang/orgs","repos_url":"https://api.github.com/users/reyang/repos","events_url":"https://api.github.com/users/reyang/events{/privacy}","received_events_url":"https://api.github.com/users/reyang/received_events","type":"User","site_admin":false},"created_at":"2018-10-26T16:41:55Z","updated_at":"2018-10-26T16:41:55Z","author_association":"COLLABORATOR","body":"@geobeau build failed due to a recent upgrade in circleci, which is unrelated to your change. I have it fixed in #362, would you update the branch again? Thank you!"}}
{"actor":{"display_login":"reyang"}}