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

Invoke-WebRequest not responding to «Ctrc+c» #16145

Closed
5 tasks done
7-904-001-67-28 opened this issue Sep 23, 2021 · 6 comments · Fixed by #19330
Closed
5 tasks done

Invoke-WebRequest not responding to «Ctrc+c» #16145

7-904-001-67-28 opened this issue Sep 23, 2021 · 6 comments · Fixed by #19330
Labels
Issue-Bug Issue has been identified as a bug in the product Resolution-Fixed The issue is fixed. WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module
Milestone

Comments

@7-904-001-67-28
Copy link

Prerequisites

Steps to reproduce

I am experiencing a problem with this comandlet.
I started it to downloading and turned off the router. Comandlet hanged and hangs for more than 10 hours.
I think it should be breaked after I push «Ctrl+c», but it continue hanging.
Sorry my English.

Expected behavior

«Ctrl+c» – and Oll Korrect.

Actual behavior

Nothing changes.

Error details

I can not start the next command.

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.4
PSEdition                      Core
GitCommitId                    7.1.4
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

I prepared the window of PowerShell and reduced the speed of the router to minimal:
2021-09-23_12-46-50
I pushed the «Enter»:
2021-09-23_12-47-08
I turned off the router:
2021-09-23_12-47-24
Now I am trying unsuccessfully to stop it.

@7-904-001-67-28 7-904-001-67-28 added the Needs-Triage The issue is new and needs to be triaged by a work group. label Sep 23, 2021
@iSazonov iSazonov added Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module labels Sep 24, 2021
@iSazonov
Copy link
Collaborator

iSazonov commented Sep 24, 2021

I can reproduce: start downloading an ISO and then disconnect Wi-Fi - PowerShell hang (no response after Ctrl-C and Wi-Fi reconnect).

@iSazonov iSazonov added Issue-Bug Issue has been identified as a bug in the product and removed Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a labels Sep 24, 2021
@iSazonov iSazonov added this to the 7.2-Consider milestone Sep 24, 2021
@7-904-001-67-28
Copy link
Author

7-904-001-67-28 commented Sep 24, 2021

If there is the VPN- or proxy-program between PowerShell and Internet, that program (probably) is returning the connection error and PowerShell by itself (without external intervention) is continue after 1-2 minutes with $_.Exception.HResult -EQ -2146232800, $_.Exception.InnerException.ErrorCode -EQ 10053 and $_.Exception.InnerException.Message -Like "Unable to read data from the transport connection: *".

@markekraus
Copy link
Contributor

Even though we have StopProcessing() implemented, because we have HttpClient.SendAsync() being run synchronously.. I think it is blocking the cancellation.

response = client.SendAsync(req, HttpCompletionOption.ResponseHeadersRead, _cancelToken.Token).GetAwaiter().GetResult();

@CarloToso
Copy link
Contributor

Related to #12249

@kasini3000
Copy link

I can reproduce:
i use Invoke-WebRequest / Invoke-RestMethod watch etcd,
but can not terminate by ctrl+c,but curl normal !

We look forward to fixing this problem as soon as possible.

@ghost ghost added In-PR Indicates that a PR is out for the issue and removed In-PR Indicates that a PR is out for the issue labels Mar 12, 2023
@ghost ghost added the In-PR Indicates that a PR is out for the issue label Mar 15, 2023
@ghost ghost added Resolution-Fixed The issue is fixed. and removed In-PR Indicates that a PR is out for the issue Needs-Triage The issue is new and needs to be triaged by a work group. labels Apr 3, 2023
@ghost
Copy link

ghost commented Apr 20, 2023

🎉This issue was addressed in #19330, which has now been successfully released as v7.4.0-preview.3.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Issue has been identified as a bug in the product Resolution-Fixed The issue is fixed. WG-Cmdlets-Utility cmdlets in the Microsoft.PowerShell.Utility module
Projects
None yet
5 participants