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

net: fix readable event not emitted (fixes #25969) #48866

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,8 @@ function internalConnect(
self, address, port, addressType, localAddress, localPort, flags) {
// TODO return promise from Socket.prototype.connect which
// wraps _connectReq.
debug('resume');
self.resume();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only resume if flowing? Or we might lose data when reconnecting a paused stream. @mcollina

Copy link
Contributor Author

@CGQAQ CGQAQ Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But flowing is always false after connected
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is that if the socket is paused or never started, you will force it to start. Causing lost data for the user.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @ronag.
Could you just check if any data event is there (which implies flowing)?

Also please consider to add whatever solution you find here in internalConnectMultiple, otherwise it will fail with network family autoselection.


assert(self.connecting);

Expand Down