[v18.x backport] backport 49574 and 50240 to v18.x by lpinca · Pull Request #52384 · nodejs/node

added 2 commits

April 6, 2024 08:07
Hard code the value of the host parameter to `common.localhostIPv4` in
`server.listen()` and `net.connect()`. This

1. ensures that the client `socket._handle` is not reinitialized during
   connection due to the family autodetection algorithm, preventing
   `parser.consume()` from being called with an invalid `socket._handle`
   parameter.
2. works around an issue in the FreeBSD 12 machine where the stress test
   is run where some sockets get stuck after connection.

PR-URL: nodejs#49574
Closes: nodejs#49565
Fixes: nodejs#49564
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
The maximum number of parsers in the free list is set to 1000. However
the test does not need to use this maximum. Reduce it to 50.

Refs: nodejs#50228 (comment)
PR-URL: nodejs#50240
Fixes: nodejs#49564
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>

@nodejs-github-bot nodejs-github-bot added needs-ci

PRs that need a full CI run.

test

Issues and PRs related to the tests.

v18.x

Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.

labels

Apr 6, 2024

marco-ippolito

richardlau pushed a commit that referenced this pull request

Apr 17, 2024
Hard code the value of the host parameter to `common.localhostIPv4` in
`server.listen()` and `net.connect()`. This

1. ensures that the client `socket._handle` is not reinitialized during
   connection due to the family autodetection algorithm, preventing
   `parser.consume()` from being called with an invalid `socket._handle`
   parameter.
2. works around an issue in the FreeBSD 12 machine where the stress test
   is run where some sockets get stuck after connection.

PR-URL: #49574
Backport-PR-URL: #52384
Closes: #49565
Fixes: #49564
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

richardlau pushed a commit that referenced this pull request

Apr 17, 2024
The maximum number of parsers in the free list is set to 1000. However
the test does not need to use this maximum. Reduce it to 50.

Refs: #50228 (comment)
PR-URL: #50240
Backport-PR-URL: #52384
Fixes: #49564
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>

@lpinca lpinca deleted the backport-49574-and-50240-to-v18.x branch

April 17, 2024 19:17