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

dgram: remove unreachable connectState assign #38590

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

pd4d10
Copy link
Contributor

@pd4d10 pd4d10 commented May 8, 2021

isConnected() returns true implies that remoteAddress() doesn't throw an error. The implementation of remoteAddress is as follows:

node/lib/dgram.js

Lines 770 to 775 in 29f1b60

Socket.prototype.remoteAddress = function() {
healthCheck(this);
const state = this[kStateSymbol];
if (state.connectState !== CONNECT_STATE_CONNECTED)
throw new ERR_SOCKET_DGRAM_NOT_CONNECTED();

It also implies that state.connectState === CONNECT_STATE_CONNECTED.

So it seems not necessary to assign it again.

@github-actions github-actions bot added dgram Issues and PRs related to the dgram subsystem / UDP. needs-ci PRs that need a full CI run. labels May 8, 2021
@pd4d10
Copy link
Contributor Author

pd4d10 commented May 8, 2021

Another thing which needs to check is that calling isConnect() has no side effect.

AFAICT it doesn't, but it is better to check again in the code review.

@oyyd oyyd added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 24, 2021
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 24, 2021
@nodejs-github-bot
Copy link
Collaborator

@oyyd
Copy link
Contributor

oyyd commented Dec 27, 2021

@pd4d10 Can you rebase against master? (so that we might have luck to get a green CI)

@oyyd oyyd added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 27, 2021
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 27, 2021
@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

aduh95 commented Jan 5, 2022

It looks like there are some relevant CI failure. Also could you rebase instead of marging? Merge commits tend to break our tooling.

@aduh95 aduh95 removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 5, 2022
@oyyd oyyd added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 5, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 5, 2022
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 5, 2022
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@oyyd
Copy link
Contributor

oyyd commented Jan 20, 2022

The CI is green now.

/cc @nodejs/dgram for more reviews.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 20, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 20, 2022
@nodejs-github-bot nodejs-github-bot merged commit 5753eb1 into nodejs:master Jan 20, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in 5753eb1

@pd4d10 pd4d10 deleted the patch-10 branch January 20, 2022 09:04
BethGriggs pushed a commit that referenced this pull request Jan 25, 2022
PR-URL: #38590
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Linkgoron pushed a commit to Linkgoron/node that referenced this pull request Jan 31, 2022
PR-URL: nodejs#38590
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
danielleadams pushed a commit that referenced this pull request Feb 28, 2022
PR-URL: #38590
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
danielleadams pushed a commit that referenced this pull request Mar 2, 2022
PR-URL: #38590
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
danielleadams pushed a commit that referenced this pull request Mar 3, 2022
PR-URL: #38590
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
danielleadams pushed a commit that referenced this pull request Mar 14, 2022
PR-URL: #38590
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. dgram Issues and PRs related to the dgram subsystem / UDP. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants