Skip to content

http: guard invalid timeout values in checkConnections#64506

Open
efekrskl wants to merge 1 commit into
nodejs:mainfrom
efekrskl:fix/invalid-headers-timeout-abort
Open

http: guard invalid timeout values in checkConnections#64506
efekrskl wants to merge 1 commit into
nodejs:mainfrom
efekrskl:fix/invalid-headers-timeout-abort

Conversation

@efekrskl

Copy link
Copy Markdown
Member

Fixes #49324

Signed-off-by: Efe Karasakal <hi@efe.dev>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added http Issues or PRs related to the http subsystem. needs-ci PRs that need a full CI run. labels Jul 14, 2026
Comment on lines +25 to +32
const { signal, status, stderr } = spawnSync(
process.execPath,
[__filename, 'child'],
{ encoding: 'utf8' },
);

assert.strictEqual(signal, null);
assert.strictEqual(status, 0, stderr);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These kinds of tests make me nervous 😅. Do we already have something similar in the repo for HTTP?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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


server.listen(0, '127.0.0.1', () => {
setTimeout(() => {
server.close(() => process.exit(0));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not just check whether .close() has been called? And that way we avoid the child part

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Because the buggy behaviour crashes the whole process at native level, so the JS assertion wouldn't run

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

Labels

http Issues or PRs related to the http subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node_http_parser.cc:1096:static void node::{anonymous}::ConnectionsList::Expired with NodeJS v18.17.0

3 participants