Skip to content

Conversation

@lukiano
Copy link

This PR is to make a recent code changes backwards compatible with previous releases of Node.JS, as depicted in #47405 (comment)

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/net

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. net Issues and PRs related to the net subsystem. labels Jul 22, 2023
lib/net.js Outdated
if(typeofoptions.highWaterMark!=='undefined'){
validateNumber(
options.highWaterMark,'options.highWaterMark',
0
Copy link
Author

Choose a reason for hiding this comment

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

I'm throwing an error if options.highWaterMark is less than zero. Alternatively, we can fallback to a default value of undefined.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm okay with being more strict and forbid negative values.

lib/net.js Outdated
this.keepAlive=Boolean(options.keepAlive);
this.keepAliveInitialDelay=~~(options.keepAliveInitialDelay/1000);
this.highWaterMark=options.highWaterMark??getDefaultHighWaterMark();
this.highWaterMark=options.highWaterMark??undefined;
Copy link
Author

Choose a reason for hiding this comment

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

Theoretically this.highWaterMark = options.highWaterMark; should suffice if we are happy with falsy values.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, let's accept falsy values.

@ShogunPanda
Copy link
Contributor

Can you also please fix linter issues?

@lukianolukianoforce-pushed the fix/watermark-at-socket-creation branch from a6dc57b to d6e7851CompareJuly 22, 2023 12:37
@ShogunPanda
Copy link
Contributor

LGTM now.
Can you also update docs?

@mcollina
Copy link
Member

Tests are failing

@lukianolukianoforce-pushed the fix/watermark-at-socket-creation branch from d6e7851 to 624f697CompareJuly 24, 2023 11:45
@lukiano
Copy link
Author

I've amended the tests.

@lukianolukianoforce-pushed the fix/watermark-at-socket-creation branch from 624f697 to b0572e0CompareJuly 24, 2023 11:49
@lukiano
Copy link
Author

I've also made the procedure more evident in the documentation.

Copy link
Contributor

@ShogunPandaShogunPanda left a comment

Choose a reason for hiding this comment

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

LGTM!

@lukianolukianoforce-pushed the fix/watermark-at-socket-creation branch from b0572e0 to 9f859b9CompareJuly 24, 2023 20:14
@lukiano
Copy link
Author

Fixed some linting issues.

@lpincalpinca added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jul 27, 2023
doc/api/http.md Outdated
`readableHighWaterMark` and `writableHighWaterMark`. This affects
`highWaterMark` property of both `IncomingMessage` and `ServerResponse`.
**Default:** See [`stream.getDefaultHighWaterMark()`][].
**Default:**`undefined`. Sockets will use the default watermark value at the time the request arrives. See [`stream.getDefaultHighWaterMark()`][].
Copy link
Member

Choose a reason for hiding this comment

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

I would keep it consistent and add a line break after 80 characters.

Copy link
Member

Choose a reason for hiding this comment

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

The lint job fails for this reason.

Copy link
Author

Choose a reason for hiding this comment

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

Addressed

@lukianolukianoforce-pushed the fix/watermark-at-socket-creation branch from 9f859b9 to 18696dfCompareJuly 28, 2023 10:08
@lpincalpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 28, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 28, 2023
@nodejs-github-bot
Copy link
Collaborator

@lpincalpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 10, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 10, 2023
@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

This needs a rebase to fix the git conflicts.

@lukiano
Copy link
Author

Thanks. Rebased

@mcollinamcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 30, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 30, 2023
@nodejs-github-bot
Copy link
Collaborator

@mcollinamcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 30, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 30, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@mcollinamcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 26, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 26, 2023
@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

This needs another rebase unfortunately

@aduh95aduh95 added the stalled Issues and PRs that are stalled. label Nov 8, 2025
@github-actions
Copy link
Contributor

This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open.

@github-actions
Copy link
Contributor

Closing this because it has stalled. Feel free to reopen if this issue/PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions.

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

Labels

needs-ciPRs that need a full CI run.netIssues and PRs related to the net subsystem.semver-majorPRs that contain breaking changes and should be released in the next major version.stalledIssues and PRs that are stalled.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@lukiano@nodejs-github-bot@ShogunPanda@mcollina@aduh95@jasnell@lpinca