FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

internal/child_process: call postSend on error by indutny · Pull Request #4752 · nodejs/node · GitHub

/ node Public

internal/child_process: call postSend on error - #4752

Closed
indutny wants to merge 1 commit into
nodejs:masterfrom
indutny:fix/handle-cleanup-in-child-process-send
Closed

internal/child_process: call postSend on error#4752
indutny wants to merge 1 commit into
nodejs:masterfrom
indutny:fix/handle-cleanup-in-child-process-send

Conversation

indutny commented Jan 19, 2016

Copy link
Copy Markdown
Member

Call obj.postSend in error case of process.send(). The
net.Socket's handle should not be leaked.


Noticed this while looking through the code. I'm not sure if any reliable test case could be written for it, but the problem seems to be kind of obvious to me.

R = @bnoordhuis or @sam-github

cc @nodejs/collaborators

indutny commented Jan 19, 2016

Copy link
Copy Markdown
Member Author

mscdex added the child_process Issues and PRs related to the child_process subsystem. label Jan 19, 2016

Copy link
Copy Markdown
Contributor

@indutny sorry, I'm not familiar enough with the code to comment

indutny commented Jan 21, 2016

Copy link
Copy Markdown
Member Author

@sam-github no worries

@bnoordhuis you are my last hope

Copy link
Copy Markdown
Contributor

@indutny With the short commit message and lack of test I'm having a hard time seeing this in context. Will be happy to review if at least one of those two can be improved/added.

indutny force-pushed the fix/handle-cleanup-in-child-process-send branch from 998145a to 1feb860 Compare January 21, 2016 07:55

indutny commented Jan 21, 2016

Copy link
Copy Markdown
Member Author

@trevnorris how about this?

Copy link
Copy Markdown
Member

LGTM but "certain callbacks invoked" sounds a bit vague; I'd write "two callbacks are invoked, send and postSend."

(Aside, it's "These callbacks", not "This callbacks.")

Call `obj.postSend` in error case of `process.send()`. The
`net.Socket`'s handle should not be leaked.

Note that there are two callbacks invoked on handles
when they are sent to the child process over IPC pipes.
These callbacks are specified by `handleConversion` object, and
during send two of them are invoked:

  * `send`
  * `postSend`

Now for `net.Socket` in particular, `postSend` performs clean up by
closing the actual uv handle. However this clean up will not happen in
one of the branches. This pull request aims to fix this.
indutny force-pushed the fix/handle-cleanup-in-child-process-send branch from 1feb860 to 994071b Compare January 22, 2016 01:33

indutny commented Jan 22, 2016

Copy link
Copy Markdown
Member Author

@bnoordhuis thank you! Does this one look better? I didn't want to repeat postSend/send, so I tried to do it a bit differently

jasnell commented Jan 22, 2016

Copy link
Copy Markdown
Member

If I'm understanding this one correctly, then LGTM but would prefer additional sign off

jasnell commented Jan 22, 2016

Copy link
Copy Markdown
Member

marking as lts-watch defensively... but not sure it's appropriate to land there yet. Need more input

Copy link
Copy Markdown
Member

Commit log LGTM.

indutny commented Jan 22, 2016

Copy link
Copy Markdown
Member Author

@jasnell hm... it should be probably a good idea, though, I'm not sure if it matters that much for LTS. Never seen a bug that caused this, this is just a sanity check commit.

indutny commented Jan 22, 2016

Copy link
Copy Markdown
Member Author

Landed in 6712a1f, thank you!

indutny closed this Jan 22, 2016
indutny added a commit that referenced this pull request Jan 22, 2016
Call `obj.postSend` in error case of `process.send()`. The
`net.Socket`'s handle should not be leaked.

Note that there are two callbacks invoked on handles
when they are sent to the child process over IPC pipes.
These callbacks are specified by `handleConversion` object, and
during send two of them are invoked:

  * `send`
  * `postSend`

Now for `net.Socket` in particular, `postSend` performs clean up by
closing the actual uv handle. However this clean up will not happen in
one of the branches. This pull request aims to fix this.

PR-URL: #4752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
rvagg pushed a commit that referenced this pull request Jan 25, 2016
Call `obj.postSend` in error case of `process.send()`. The
`net.Socket`'s handle should not be leaked.

Note that there are two callbacks invoked on handles
when they are sent to the child process over IPC pipes.
These callbacks are specified by `handleConversion` object, and
during send two of them are invoked:

  * `send`
  * `postSend`

Now for `net.Socket` in particular, `postSend` performs clean up by
closing the actual uv handle. However this clean up will not happen in
one of the branches. This pull request aims to fix this.

PR-URL: #4752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Feb 17, 2016
Call `obj.postSend` in error case of `process.send()`. The
`net.Socket`'s handle should not be leaked.

Note that there are two callbacks invoked on handles
when they are sent to the child process over IPC pipes.
These callbacks are specified by `handleConversion` object, and
during send two of them are invoked:

  * `send`
  * `postSend`

Now for `net.Socket` in particular, `postSend` performs clean up by
closing the actual uv handle. However this clean up will not happen in
one of the branches. This pull request aims to fix this.

PR-URL: #4752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Feb 18, 2016
Call `obj.postSend` in error case of `process.send()`. The
`net.Socket`'s handle should not be leaked.

Note that there are two callbacks invoked on handles
when they are sent to the child process over IPC pipes.
These callbacks are specified by `handleConversion` object, and
during send two of them are invoked:

  * `send`
  * `postSend`

Now for `net.Socket` in particular, `postSend` performs clean up by
closing the actual uv handle. However this clean up will not happen in
one of the branches. This pull request aims to fix this.

PR-URL: #4752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins mentioned this pull request Feb 18, 2016
MylesBorins pushed a commit that referenced this pull request Mar 2, 2016
Call `obj.postSend` in error case of `process.send()`. The
`net.Socket`'s handle should not be leaked.

Note that there are two callbacks invoked on handles
when they are sent to the child process over IPC pipes.
These callbacks are specified by `handleConversion` object, and
during send two of them are invoked:

  * `send`
  * `postSend`

Now for `net.Socket` in particular, `postSend` performs clean up by
closing the actual uv handle. However this clean up will not happen in
one of the branches. This pull request aims to fix this.

PR-URL: #4752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
Call `obj.postSend` in error case of `process.send()`. The
`net.Socket`'s handle should not be leaked.

Note that there are two callbacks invoked on handles
when they are sent to the child process over IPC pipes.
These callbacks are specified by `handleConversion` object, and
during send two of them are invoked:

  * `send`
  * `postSend`

Now for `net.Socket` in particular, `postSend` performs clean up by
closing the actual uv handle. However this clean up will not happen in
one of the branches. This pull request aims to fix this.

PR-URL: nodejs#4752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

child_process Issues and PRs related to the child_process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL