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: append actual errors to ERR_SOCKET_CANNOT_SEND #27865

Closed
wants to merge 1 commit into from

Conversation

oyyd
Copy link
Contributor

@oyyd oyyd commented May 25, 2019

One of our apps has used up all available ports because of misuse and we have noticed some ERR_SOCKET_CANNOT_SEND errors in our logs indicating this. I think appending the actual errors to the ERR_SOCKET_CANNOT_SEND error would help with diagnosing.

This commit appends the actual error to the emitted ERR_SOCKET_CANNOT_SEND
error so that we could know the detailed reason why the send() operation
failed.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

This commit appends the actual error to the emitted
`ERR_SOCKET_CANNOT_SEND` error so that we could know the detailed
reason why the `send()` operation failed.
@nodejs-github-bot

This comment has been minimized.

@oyyd oyyd added the dgram Issues and PRs related to the dgram subsystem / UDP. label May 29, 2019
@nodejs-github-bot

This comment has been minimized.

@oyyd
Copy link
Contributor Author

oyyd commented May 29, 2019

/cc @nodejs/dgram Someone might help to take a look.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

// Append `causedByError` to the `error`.
function addCausedByError(error, message, causedByError) {
let msg = message;
if (causedByError) {
Copy link
Member

Choose a reason for hiding this comment

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

It might actually make sense to remove this if statement. If the cause is e.g., a thrown undefined or false, so be it.

@BridgeAR
Copy link
Member

@oyyd sorry that it took so long for someone to look at this again. This needs a rebase by now but otherwise this seems good to go.

@Trott
Copy link
Member

Trott commented Apr 23, 2020

Did #31958 handle this issue (differently) and this can/should now be closed?

@oyyd
Copy link
Contributor Author

oyyd commented Apr 24, 2020

Yes, it looks like #31958 has fixed this gracefully. I'm closing this PR.

@oyyd oyyd closed this Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dgram Issues and PRs related to the dgram subsystem / UDP. review wanted PRs that need reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants