{"action":"created","issue":{"url":"https://api.github.com/repos/hdinsight/hbase-sdk-for-net/issues/46","repository_url":"https://api.github.com/repos/hdinsight/hbase-sdk-for-net","labels_url":"https://api.github.com/repos/hdinsight/hbase-sdk-for-net/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/hdinsight/hbase-sdk-for-net/issues/46/comments","events_url":"https://api.github.com/repos/hdinsight/hbase-sdk-for-net/issues/46/events","html_url":"https://github.com/hdinsight/hbase-sdk-for-net/issues/46","id":124747846,"number":46,"title":"Deadlock in WebRequesterBasic","user":{"login":"anirudhsanthiar","id":12654369,"avatar_url":"https://avatars.githubusercontent.com/u/12654369?v=3","gravatar_id":"","url":"https://api.github.com/users/anirudhsanthiar","html_url":"https://github.com/anirudhsanthiar","followers_url":"https://api.github.com/users/anirudhsanthiar/followers","following_url":"https://api.github.com/users/anirudhsanthiar/following{/other_user}","gists_url":"https://api.github.com/users/anirudhsanthiar/gists{/gist_id}","starred_url":"https://api.github.com/users/anirudhsanthiar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anirudhsanthiar/subscriptions","organizations_url":"https://api.github.com/users/anirudhsanthiar/orgs","repos_url":"https://api.github.com/users/anirudhsanthiar/repos","events_url":"https://api.github.com/users/anirudhsanthiar/events{/privacy}","received_events_url":"https://api.github.com/users/anirudhsanthiar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-04T12:08:04Z","updated_at":"2016-03-24T22:33:44Z","closed_at":null,"body":"In the WebRequesterBasic class, we have the following method:\r\n\r\n    public HttpWebResponse IssueWebRequest(string endpoint, string method = \"GET\", Stream input =   null)\r\n    {\r\n       var response =  IssueWebRequestAsync(endpoint, method, input).Result;\r\n       return response;\r\n    }\r\n\r\nA GUI client (such as a Windows Forms app) or an MVC client will deadlock if it calls the method as follows:\r\n    `var requester = new Microsoft.HBase.Client.WebRequesterBasic();\r\n    requester.IssueWebRequest(\"https://github.com/hdinsight/hbase-sdk-for-net\");`\r\n\r\nMixing synchronous and asynchronous waiting is dangerous, see, for example http://blog.stephencleary.com/2012/07/dont-block-on-async-code.html\r\n\r\nThere are instances of synchronous blocking in `WebRequesterSecure` and `WebRequester` as well.\r\nA possible fix would be to configure the awaits `IssueWebRequestAsync` to not capture the current `SynchronizationContext` using `ConfigureAwait(false)`"},"comment":{"url":"https://api.github.com/repos/hdinsight/hbase-sdk-for-net/issues/comments/201058000","html_url":"https://github.com/hdinsight/hbase-sdk-for-net/issues/46#issuecomment-201058000","issue_url":"https://api.github.com/repos/hdinsight/hbase-sdk-for-net/issues/46","id":201058000,"user":{"login":"duoxu","id":6750120,"avatar_url":"https://avatars.githubusercontent.com/u/6750120?v=3","gravatar_id":"","url":"https://api.github.com/users/duoxu","html_url":"https://github.com/duoxu","followers_url":"https://api.github.com/users/duoxu/followers","following_url":"https://api.github.com/users/duoxu/following{/other_user}","gists_url":"https://api.github.com/users/duoxu/gists{/gist_id}","starred_url":"https://api.github.com/users/duoxu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duoxu/subscriptions","organizations_url":"https://api.github.com/users/duoxu/orgs","repos_url":"https://api.github.com/users/duoxu/repos","events_url":"https://api.github.com/users/duoxu/events{/privacy}","received_events_url":"https://api.github.com/users/duoxu/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T22:33:44Z","updated_at":"2016-03-24T22:33:44Z","body":"@anirudhsanthiar We are planning to expose async APIs only, so that it will not confuse people any more. "}}