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

Aix, ibmi: Handle server hang when remote sends TCP RST #3481

Closed
V-for-Vasili opened this issue Feb 15, 2022 · 2 comments
Closed

Aix, ibmi: Handle server hang when remote sends TCP RST #3481

V-for-Vasili opened this issue Feb 15, 2022 · 2 comments

Comments

@V-for-Vasili
Copy link
Contributor

V-for-Vasili commented Feb 15, 2022

  • Version: v1.x
  • Platform: Aix 7.2, IBMi 7.3, IBMi 7.4

Due to implementation of SO_ERROR on Aix and ibmi, as soon as remote sends RST packet, socket fd corresponding to an opened connection immediately enters an error state with SO_ERROR=73 (ECONNRESET), and getsockname() returns EINVAL while there are still readable bytes on the fd. Subsequent read() operation would succeed despite the error state of the fd.

In such case peerfd may sometimes enter error state shortly after being accepted by uv__accept() without any additional action being performed on the fd by libuv. On Aix and IBMi, this sometimes causes uv_pipe_pending_type() to return UV_UNKNOWN_HANDLE due to getsockname() failing, which in many cases causes the listening server to stop replying to
new incoming connections.

When used in node.js, the consequence of this is that a simple http server application can receive a RST packet and "hang", not processing and replying to fresh incoming connections.

Issue was first observed in Node when using Nessus scanner with a simple server application that uses cluster: nodejs/node#40724.

On Aix, IBMi the use of cluster appears to increase the frequency with which application can "hang".

Proposed fix: #3482

@V-for-Vasili
Copy link
Contributor Author

cc @libuv/aix @libuv/ibmi

@V-for-Vasili
Copy link
Contributor Author

Patch landed, can close now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants