Repository navigation
Fix cancellation of WinHttpHandler response stream reads - #8693
Conversation
Reading from the response stream using ReadAsync() was ignoring the cancellation token passed in. To fix this, registered a delegate that will be called to dispose the WinHTTP request handle during pending I/O. This will cause the WinHTTP operation to cancel. Added tests. For now, left them disabled to be resolved in issue #8692 next week. But wanted to get this fix in asap since it blocks partners for RTM. Fixes #8662.
|
cc: @stephentoub @CIPop |
| // TODO: Issue #2165. Register callback on cancellation token to cancel WinHTTP operation. | ||
|
|
||
| // Register callback on cancellation token to cancel any pending WinHTTP operation. | ||
| if (token != CancellationToken.None) |
| public class CancellationTest | ||
| { | ||
| // TODO: Issue #8692. Move this test server capability to Azure test server or Loopback server. | ||
| private const string FastHeadersSlowBodyHost = "winrtnet.corp.microsoft.com"; |
There was a problem hiding this comment.
Is this a publicly exposed endpoint? If not, do we want to make it publicly exposed?
Can we instead add the testing functionality to the Azure based servers?
There was a problem hiding this comment.
I see there is an issue tracking the change: maybe we should remove the endpoint name and use an environment variable instead.
There was a problem hiding this comment.
That endpoint is not publicly accessible.
I have an issue tracking changing this to the Azure test server (or even using Loopback server). So, I wasn't going to do the environment variable thing for this since it would be rolled into the current environment variable we have for the rest of the Azure tests.
There was a problem hiding this comment.
I think an environment variable is best in this case: it achieves the same purpose internally and it doesn't expose intranet resource information.
There was a problem hiding this comment.
I will remove the DNS name of the internal server and replace it with a TODO. Since the tests are disabled right now w/ ActiveIssue, it will be ok. There is a GitHub issue tracking to re-enable this.
|
Test Innerloop OSX Debug Build and Test please |
|
LGTM |
|
Test Innerloop OSX Release Build and Test please |
…celread Fix cancellation of WinHttpHandler response stream reads Commit migrated from dotnet/corefx@7a55665
Reading from the response stream using ReadAsync() was ignoring the cancellation token passed in. To fix this, registered a delegate that will be called to dispose the WinHTTP request handle during pending I/O. This will cause the WinHTTP operation to cancel.
Added tests. For now, left them disabled to be resolved in issue #8692 next week. But wanted to get this fix in asap since it blocks partners for RTM.
Fixes #8662.