Bug 37857

Summary: WebRequest Time out
Product: [Mono] Class Libraries Reporter: Paresh <pthakkar>
Component: SystemAssignee: Bugzilla <bugzilla>
Status: NEEDINFO ---    
Severity: normal CC: abock, masafa, mono-bugs+monomac, mono-bugs+mono, pj.beaman, rolf, sebastien
Priority: ---    
Version: unspecified   
Target Milestone: Untriaged   
Hardware: Macintosh   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Timeout

Description Paresh 2016-01-21 01:02:00 UTC
Created attachment 14647 [details]
Timeout

Our Client App retrieves documents from SharePoint server. When we hit a document URL that does not exist the Request times out. Besides this we do not have any other issues and it works fine on Windows. This timeout issue has been reproduced using HttpClient, WebRequest, and RestSharp (this internally uses WebRequest) APIs. 

 at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00046] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/mcs/class/System/System.Net/HttpWebRequest.cs:940 
  at System.Net.HttpWebRequest.GetResponse () [0x0000e] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/mcs/class/System/System.Net/HttpWebRequest.cs:958 
  at RestSharp.Http.GetRawResponse (System.Net.HttpWebRequest request) [0x00002] in <filename unknown>:0 


Xamarin Studio
Version 5.10.1 (build 6)
Installation UUID: 6a7bbb45-a541-440e-81e7-e1bad476a27e
Runtime:
	Mono 4.2.1 (explicit/6dd2d0d)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010102

Xamarin.Profiler
Not Installed

Apple Developer Tools
Xcode 7.2 (9548)
Build 7C68

Xamarin.iOS
Not Installed

Xamarin.Android
Not Installed

Xamarin Android Player
Not Installed

Xamarin.Mac
Version: 2.4.0.109 (Business Edition)

Build Information
Release ID: 510010006
Git revision: 0b60eecdb531933734519c13257d16a780274aab
Build date: 2015-12-04 20:28:20-05
Xamarin addins: 9876fd7c9837977178411ec7375b4352c0a0d6af
Build lane: monodevelop-lion-cycle6-baseline

Operating System
Mac OS X 10.11.2
Darwin Pareshs-Mac-mini.local 15.2.0 Darwin Kernel Version 15.2.0
    Fri Nov 13 19:56:56 PST 2015
    root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
Comment 1 Chris Hamons 2016-01-21 15:05:15 UTC
System.Net.HttpWebRequest and friends are all BCL classes. Moving to the correct product.
Comment 2 Marek Safar 2016-01-28 12:39:20 UTC
Could you help us and provide some way to reproduce the issue?
Comment 3 Paresh 2016-02-04 00:48:53 UTC
Please use either client HttpRequest to download a file successfully. Remove the file or change the request Url so it cannot find that file. You should receive a time out. Please let me know if you need more information.
Comment 4 Marek Safar 2016-02-11 11:35:59 UTC
I don't. Trying with simple repro everything works

using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;

class X
{
	public static void Main ()
	{
		TestDownload ().Wait ();
	}

	static async Task TestDownload ()
	{
		var c = new HttpClient ();
		var stream = await c.GetStreamAsync ("https://github.com/mono/mono/blob/master/acceptance-tests/Makefile.am-missing");
		await stream.CopyToAsync (new MemoryStream ());
	}
}

Fails as expected with

System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: 404 (Not Found)
  at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode ()
Comment 5 Paresh 2016-02-16 22:38:25 UTC
Hi Marek, We are certainly seeing time out issues. You are getting AggregateException. Could you please list all the Exceptions? Could you also try non async call?

Thank you!
Comment 6 Marek Safar 2016-02-29 14:15:43 UTC
That's the only exception I get.

What non-async call? HttpClient supports only async methods.