{"action":"created","issue":{"url":"https://api.github.com/repos/wojciech12/talk_zero_downtime_deployment_with_kubernetes/issues/5","repository_url":"https://api.github.com/repos/wojciech12/talk_zero_downtime_deployment_with_kubernetes","labels_url":"https://api.github.com/repos/wojciech12/talk_zero_downtime_deployment_with_kubernetes/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/wojciech12/talk_zero_downtime_deployment_with_kubernetes/issues/5/comments","events_url":"https://api.github.com/repos/wojciech12/talk_zero_downtime_deployment_with_kubernetes/issues/5/events","html_url":"https://github.com/wojciech12/talk_zero_downtime_deployment_with_kubernetes/issues/5","id":385507570,"node_id":"MDU6SXNzdWUzODU1MDc1NzA=","number":5,"title":"'locks' inside async/await code","user":{"login":"mmisztal1980","id":1357057,"node_id":"MDQ6VXNlcjEzNTcwNTc=","avatar_url":"https://avatars1.githubusercontent.com/u/1357057?v=4","gravatar_id":"","url":"https://api.github.com/users/mmisztal1980","html_url":"https://github.com/mmisztal1980","followers_url":"https://api.github.com/users/mmisztal1980/followers","following_url":"https://api.github.com/users/mmisztal1980/following{/other_user}","gists_url":"https://api.github.com/users/mmisztal1980/gists{/gist_id}","starred_url":"https://api.github.com/users/mmisztal1980/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmisztal1980/subscriptions","organizations_url":"https://api.github.com/users/mmisztal1980/orgs","repos_url":"https://api.github.com/users/mmisztal1980/repos","events_url":"https://api.github.com/users/mmisztal1980/events{/privacy}","received_events_url":"https://api.github.com/users/mmisztal1980/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-28T23:52:46Z","updated_at":"2018-11-28T23:54:22Z","closed_at":null,"author_association":"NONE","body":"Since this code is to be used as an example, I feel it is important to highlight one really bad practice:\r\n- You must not mix System.Threading synchronization primitives such as `lock` with `async/await` code.\r\n\r\nThe reason is that the async/await code runs on your synchronization context, in this case the default is the ThreadPool which contains N threads that are used to asynchronously execute `Task(s)`. If you `lock`, you effectively lock one of the threads in the threadpool, preventing other async operations from using it, until the lock is released.\r\n\r\nPlease remove the locks and use [Interlocked](https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked?view=netframework-4.7.2) instead."},"comment":{"url":"https://api.github.com/repos/wojciech12/talk_zero_downtime_deployment_with_kubernetes/issues/comments/442651829","html_url":"https://github.com/wojciech12/talk_zero_downtime_deployment_with_kubernetes/issues/5#issuecomment-442651829","issue_url":"https://api.github.com/repos/wojciech12/talk_zero_downtime_deployment_with_kubernetes/issues/5","id":442651829,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjY1MTgyOQ==","user":{"login":"wojciech12","id":30651937,"node_id":"MDQ6VXNlcjMwNjUxOTM3","avatar_url":"https://avatars3.githubusercontent.com/u/30651937?v=4","gravatar_id":"","url":"https://api.github.com/users/wojciech12","html_url":"https://github.com/wojciech12","followers_url":"https://api.github.com/users/wojciech12/followers","following_url":"https://api.github.com/users/wojciech12/following{/other_user}","gists_url":"https://api.github.com/users/wojciech12/gists{/gist_id}","starred_url":"https://api.github.com/users/wojciech12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojciech12/subscriptions","organizations_url":"https://api.github.com/users/wojciech12/orgs","repos_url":"https://api.github.com/users/wojciech12/repos","events_url":"https://api.github.com/users/wojciech12/events{/privacy}","received_events_url":"https://api.github.com/users/wojciech12/received_events","type":"User","site_admin":false},"created_at":"2018-11-28T23:54:22Z","updated_at":"2018-11-28T23:54:22Z","author_association":"OWNER","body":"@mmisztal1980 Could you provide a PR showing the fix?"}}
{"actor":{"display_login":"wojciech12"}}