Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpClient requests not cancelled in Dispose() #11441

Closed
dominikprzywara opened this issue Oct 30, 2018 · 0 comments

Comments

@dominikprzywara
Copy link
Contributor

@dominikprzywara dominikprzywara commented Oct 30, 2018

Currently running HttpClient requests are not cancelled when going out of using scope

Steps to Reproduce

Example method

public Task<string> GetString(string url)
{
	using (var client = new HttpClient())	
	{
		return client.GetStringAsync(url);
	}
}

Current Behavior

Download completes without interruption.

Expected Behavior

System.Threading.Tasks.TaskCanceledException thrown

On which platforms did you notice this

[x ] macOS
[ ] Linux
[ ] Windows

monojenkins added a commit that referenced this issue Nov 6, 2018
[2018-10] Added missing cts.Cancel() in HttpClient Dispose() method

Backport of #11442.

/cc @marek-safar @domino46

Description:
Fixes #11441
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.