-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
[windows] [readline] [https] Closing input halts event loop #21771
Comments
Cannot reproduce on |
Hm.. while I get those |
@bzoz What OS and version of OS are you on? Also, do you ever see "TWO completed the request"? |
Win10 17134.165 |
@coolaj86, are you maybe using ConEmu or some other console emulator? |
Able to reproduce the issue on reported version v10.6.0 using Windows 8.1 x64 and command prompt. C:\> node 21771.js
Type anything: a
ONE response received
ONE got some data
ONE completed the request
closed the readline
(before loop is checked) Also, inserting setTimeout(() =>
console.log('ok'),
1e4); at the beginning of the script and waiting 10 seconds prints nothing, but the cpu usage is 0. |
Windows Server 2016 Datacenter v1607 is also affected, with node v10.13.0 and 11.2, on both commdand prompt and powershell Both the suggested workarounds fix this issue |
This workaround fix a nodejs issue (nodejs/node#21771) that cause porcli to not work on windows
@ronag this seems streams related and I guess you might want to have a look at this. |
@BridgeAR I wouldn't mind looking into this but I don't have a Windows setup anymore. Any advice in regards to how to have a virtual setup? Is there a any online service which could just give me a e.g. a ssh to windows machine? |
@ronag I can provide you a virtual machine (VirtualBox or VMWare) with Windows operating system installed (I have almost any Windows version from Windows 95 to the latest Windows 10). Just let me know which Windows version you want and how much RAM and HDD space the virtual machine should have so that you can run it smoothly on your system. |
@Hakerh400: Much appreciated! A Windows 10 with 1G ram and 64 GB HDD should be enough. |
Username: |
1 - Still an issue on node v12.16.3/Windows 10/Powershell |
#30701 |
I've investigated this issue with Node v18.20.2, v20.16.0 and v22.7.0. All of them worked as expected. |
Per the comment above. |
It turns out that if you have
readline
open as a terminal, ask a question, make an http request, then close readline, the even loop appears to halt on the next http request.No error. No timeout. Just sits there for minutes or hours or days.
Does not affect Mac or Linux, just Windows.
Took me a few hours of debugging over a few days to figure out that I wasn't doing anything wrong in my code and then reduce it down far enough to produce an isolated test case that proves I'm not going insane. :)
Possibly related bugs
Possible workarounds
terminal: false
rl.close()
The text was updated successfully, but these errors were encountered: