-
Notifications
You must be signed in to change notification settings - Fork 30.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Inconsistent net/socket behavior #45382
Comments
I am using Windows WSL and do not face the same issue. |
Yes, the reason for this is that data is not flowing. The buffer is filled and the |
@lpinca the current node.js impl is quite confusing. Why increasing the sent data by just 100KB will make the client dead? |
Because it fills the buffer and the other peer is not reading. Also, the client is not dead. If you keep writing, |
@lpinca Such inconsistent behavior is quite confusing and unfriendly to developers. |
No, it shouldn't discard anything. The stream is "paused". This is how all streams work in Node.js. |
This seems to be a misunderstanding more than a bug so I'll go ahead and convert it to a discussion. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Version
v20.0.0-pre
Platform
Linux xeon-intel-6252N 5.15.0-41-generic #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
net
What steps will reproduce the bug?
client side code (myclient.js):
server side code (myserver.js):
How often does it reproduce? Is there a required condition?
It always happen with my tested node binary from nodev16 to nodev20.
What is the expected behavior?
The client will exit and print the console output as (when client's buf length is 2500*1024):
afterWrite
all content write finished
What do you see instead?
The client will stuck(dead) and print the console output as (when client's buf length is 2600*1024):
afterWrite
Additional information
Such inconsistent behavior is quite misleading. Node.js should represent consistent behavior whatever the buf length is.
There are several workarounds:
The text was updated successfully, but these errors were encountered: