Bug 42589 - HttpWebRequest ignoring timeout > 140 seconds
Summary: HttpWebRequest ignoring timeout > 140 seconds
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Net.Http ()
Version: unspecified
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Future Release
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-07-15 11:45 UTC by Ole Friis Østergaard
Modified: 2016-08-31 21:00 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Timeout example (4.25 KB, application/zip)
2016-07-15 11:45 UTC, Ole Friis Østergaard
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Ole Friis Østergaard 2016-07-15 11:45:32 UTC
Created attachment 16681 [details]
Timeout example

Very simple example:

  var request = (HttpWebRequest) WebRequest.Create("http://localhost:4567/timeout"); // Some very slow endpoint
  request.Timeout = 1000000; // More than 16 minutes
  request.GetResponse());

The above will time out after approximately 2 minutes 20 seconds (well, unless the server responds before that).

Attached is a very simple C# solution and a simple Sinatra web server for reproducing. The server sleeps for 2 minutes 40 seconds before responding, the client times out after 2 minutes 20 seconds.

Running the same example from .NET on Windows (towards the same server) works fine - waits for 2 minutes 40 seconds, doesn't throw any exceptions.

Running Mono 4.4.1 on OS X 10.11.5.
Comment 1 Chris Hamons 2016-07-15 13:42:31 UTC
MonoMac, and Xamarin.Mac are products that allow you to target desktop OS X (Cocoa). Since this issue appears unrelated, and only deals with HttpWebRequest, I've moved it to the right section.
Comment 2 Ole Friis Østergaard 2016-07-18 05:49:38 UTC
Thanks Chris! I sure did ponder about the Product/Component, but wasn't able to find anything better... Thanks for doing that!
Comment 3 Marek Safar 2016-08-31 14:49:02 UTC
It works fine with Mono master and Mono 4.6. I get a response after 160 seconds
Comment 4 Rodrigo Kumpera 2016-08-31 21:00:52 UTC
This was a mono 4.4 regression that Ludovic fixed.

The current version on the alpha channel should fix the issue.