-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
net: handle.onread called again after UV_EOF #32487
Copy link
Copy link
Closed
Labels
libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.netIssues and PRs related to the net subsystem.Issues and PRs related to the net subsystem.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Metadata
Metadata
Assignees
Labels
libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.netIssues and PRs related to the net subsystem.Issues and PRs related to the net subsystem.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
A continuation of https://github.com/nodejs/node/pull/31806/files#r382938926.
On the following platforms the
handle.onreadis invoked again afterUV_EOFunless the handle ishandle.close():ed in the same tick asUV_EOFoccurs.https://github.com/nodejs/node/blob/master/lib/internal/stream_base_commons.js#L163
https://github.com/nodejs/node/blob/master/lib/net.js#L242
The workaround in #31806 is to call
handle.readStop()afterUV_EOFwhich seems to resolve the issue.We didn't notice this previously since
handle.onreadis assigned a noop and/orhandle.closeis called, insideSocket._destroywhich in turn was invoked synchronously with'end'.I have a VM where this is easily reproducible.