Closed
Description
A continuation of https://github.com/nodejs/node/pull/31806/files#r382938926.
On the following platforms the handle.onread
is invoked again after UV_EOF
unless the handle is handle.close()
:ed in the same tick as UV_EOF
occurs.
- win10-COMPILED_BY-vs2019
- win2012r2-COMPILED_BY-vs2019-x86
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()
after UV_EOF
which seems to resolve the issue.
We didn't notice this previously since handle.onread
is assigned a noop and/or handle.close
is called, inside Socket._destroy
which in turn was invoked synchronously with 'end'
.
I have a VM where this is easily reproducible.