{"action":"created","issue":{"url":"https://api.github.com/repos/xamarin/xamarin-macios/issues/5190","repository_url":"https://api.github.com/repos/xamarin/xamarin-macios","labels_url":"https://api.github.com/repos/xamarin/xamarin-macios/issues/5190/labels{/name}","comments_url":"https://api.github.com/repos/xamarin/xamarin-macios/issues/5190/comments","events_url":"https://api.github.com/repos/xamarin/xamarin-macios/issues/5190/events","html_url":"https://github.com/xamarin/xamarin-macios/issues/5190","id":384891112,"node_id":"MDU6SXNzdWUzODQ4OTExMTI=","number":5190,"title":"[Foundation]NSUrlSessionHandler does not respect the timeout that is set in the HttpClient.","user":{"login":"mandel-macaque","id":2190086,"node_id":"MDQ6VXNlcjIxOTAwODY=","avatar_url":"https://avatars2.githubusercontent.com/u/2190086?v=4","gravatar_id":"","url":"https://api.github.com/users/mandel-macaque","html_url":"https://github.com/mandel-macaque","followers_url":"https://api.github.com/users/mandel-macaque/followers","following_url":"https://api.github.com/users/mandel-macaque/following{/other_user}","gists_url":"https://api.github.com/users/mandel-macaque/gists{/gist_id}","starred_url":"https://api.github.com/users/mandel-macaque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mandel-macaque/subscriptions","organizations_url":"https://api.github.com/users/mandel-macaque/orgs","repos_url":"https://api.github.com/users/mandel-macaque/repos","events_url":"https://api.github.com/users/mandel-macaque/events{/privacy}","received_events_url":"https://api.github.com/users/mandel-macaque/received_events","type":"User","site_admin":false},"labels":[{"id":361456712,"node_id":"MDU6TGFiZWwzNjE0NTY3MTI=","url":"https://api.github.com/repos/xamarin/xamarin-macios/labels/bug","name":"bug","color":"ee0701","default":true},{"id":770328998,"node_id":"MDU6TGFiZWw3NzAzMjg5OTg=","url":"https://api.github.com/repos/xamarin/xamarin-macios/labels/iOS","name":"iOS","color":"edd60e","default":false},{"id":770328881,"node_id":"MDU6TGFiZWw3NzAzMjg4ODE=","url":"https://api.github.com/repos/xamarin/xamarin-macios/labels/macOS","name":"macOS","color":"edd60e","default":false}],"state":"open","locked":false,"assignee":{"login":"spouliot","id":260465,"node_id":"MDQ6VXNlcjI2MDQ2NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/260465?v=4","gravatar_id":"","url":"https://api.github.com/users/spouliot","html_url":"https://github.com/spouliot","followers_url":"https://api.github.com/users/spouliot/followers","following_url":"https://api.github.com/users/spouliot/following{/other_user}","gists_url":"https://api.github.com/users/spouliot/gists{/gist_id}","starred_url":"https://api.github.com/users/spouliot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spouliot/subscriptions","organizations_url":"https://api.github.com/users/spouliot/orgs","repos_url":"https://api.github.com/users/spouliot/repos","events_url":"https://api.github.com/users/spouliot/events{/privacy}","received_events_url":"https://api.github.com/users/spouliot/received_events","type":"User","site_admin":false},"assignees":[{"login":"spouliot","id":260465,"node_id":"MDQ6VXNlcjI2MDQ2NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/260465?v=4","gravatar_id":"","url":"https://api.github.com/users/spouliot","html_url":"https://github.com/spouliot","followers_url":"https://api.github.com/users/spouliot/followers","following_url":"https://api.github.com/users/spouliot/following{/other_user}","gists_url":"https://api.github.com/users/spouliot/gists{/gist_id}","starred_url":"https://api.github.com/users/spouliot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spouliot/subscriptions","organizations_url":"https://api.github.com/users/spouliot/orgs","repos_url":"https://api.github.com/users/spouliot/repos","events_url":"https://api.github.com/users/spouliot/events{/privacy}","received_events_url":"https://api.github.com/users/spouliot/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/xamarin/xamarin-macios/milestones/9","html_url":"https://github.com/xamarin/xamarin-macios/milestone/9","labels_url":"https://api.github.com/repos/xamarin/xamarin-macios/milestones/9/labels","id":2969797,"node_id":"MDk6TWlsZXN0b25lMjk2OTc5Nw==","number":9,"title":"Future","description":"Reviewed but not assigned to a specific milestone","creator":{"login":"spouliot","id":260465,"node_id":"MDQ6VXNlcjI2MDQ2NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/260465?v=4","gravatar_id":"","url":"https://api.github.com/users/spouliot","html_url":"https://github.com/spouliot","followers_url":"https://api.github.com/users/spouliot/followers","following_url":"https://api.github.com/users/spouliot/following{/other_user}","gists_url":"https://api.github.com/users/spouliot/gists{/gist_id}","starred_url":"https://api.github.com/users/spouliot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spouliot/subscriptions","organizations_url":"https://api.github.com/users/spouliot/orgs","repos_url":"https://api.github.com/users/spouliot/repos","events_url":"https://api.github.com/users/spouliot/events{/privacy}","received_events_url":"https://api.github.com/users/spouliot/received_events","type":"User","site_admin":false},"open_issues":190,"closed_issues":303,"state":"open","created_at":"2017-12-10T22:47:28Z","updated_at":"2018-12-17T23:15:04Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2018-11-27T16:53:59Z","updated_at":"2018-12-18T16:41:35Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Following the description found in https://developercommunity.visualstudio.com/content/problem/388530/httpclienttimeout-values-set-above-default-100-sec.html I have been able to confirm that when using the NSUrlSessionHandler as the message handler for the HttpClient, we do not respect the given timeout. The following code can be used as an example:\r\n\r\n```CSharp\r\n HttpClient client = new HttpClient();\r\n client.Timeout = TimeSpan.FromSeconds (150);\r\n client.BaseAddress = new Uri(\"http://slowwly.robertomurray.co.uk\");\r\n client.DefaultRequestHeaders.Accept.Clear();\r\n client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue(\"application/json\"));\r\n HttpResponseMessage response = await client.GetAsync(\"http://slowwly.robertomurray.co.uk/delay/160000/url/http://www.google.co.uk\");\r\nresponse.EnsureSuccessStatusCode();\r\n```\r\n\r\nThis happens because, when the message handler is instantiated the NSUrlSessionConfiguration does not has its TimeoutIntervalForRequest set to the correct value and uses the default, which is 60 seconds. \r\n\r\nThe solution would be to set the timeout used by the handler so that when the configuration is created the correct timeout is used."},"comment":{"url":"https://api.github.com/repos/xamarin/xamarin-macios/issues/comments/448286233","html_url":"https://github.com/xamarin/xamarin-macios/issues/5190#issuecomment-448286233","issue_url":"https://api.github.com/repos/xamarin/xamarin-macios/issues/5190","id":448286233,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODI4NjIzMw==","user":{"login":"spouliot","id":260465,"node_id":"MDQ6VXNlcjI2MDQ2NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/260465?v=4","gravatar_id":"","url":"https://api.github.com/users/spouliot","html_url":"https://github.com/spouliot","followers_url":"https://api.github.com/users/spouliot/followers","following_url":"https://api.github.com/users/spouliot/following{/other_user}","gists_url":"https://api.github.com/users/spouliot/gists{/gist_id}","starred_url":"https://api.github.com/users/spouliot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spouliot/subscriptions","organizations_url":"https://api.github.com/users/spouliot/orgs","repos_url":"https://api.github.com/users/spouliot/repos","events_url":"https://api.github.com/users/spouliot/events{/privacy}","received_events_url":"https://api.github.com/users/spouliot/received_events","type":"User","site_admin":false},"created_at":"2018-12-18T16:41:35Z","updated_at":"2018-12-18T16:41:35Z","author_association":"CONTRIBUTOR","body":"The `CFNetworkHandler` issue is different, it hangs because there's an Open and Close (no data in between) so it _might_ be unrelated to the timeout (just a different, less common issue). I'll open another bug for it since it lives in the mono repo and won't be fixed by the same PR."}}
{"actor":{"display_login":"spouliot"}}