Replies: 7 comments 2 replies
-
I am using Windows WSL and do not face the same issue. |
Beta Was this translation helpful? Give feedback.
-
Yes, the reason for this is that data is not flowing. The buffer is filled and the |
Beta Was this translation helpful? Give feedback.
-
@lpinca the current node.js impl is quite confusing. Why increasing the sent data by just 100KB will make the client dead? |
Beta Was this translation helpful? Give feedback.
-
Because it fills the buffer and the other peer is not reading. Also, the client is not dead. If you keep writing, |
Beta Was this translation helpful? Give feedback.
-
@lpinca Such inconsistent behavior is quite confusing and unfriendly to developers. |
Beta Was this translation helpful? Give feedback.
-
No, it shouldn't discard anything. The stream is "paused". This is how all streams work in Node.js. |
Beta Was this translation helpful? Give feedback.
-
This seems to be a misunderstanding more than a bug so I'll go ahead and convert it to a discussion. |
Beta Was this translation helpful? Give feedback.
-
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:
Beta Was this translation helpful? Give feedback.
All reactions