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

net: ensure WriteWrap references the handle #1590

Closed
wants to merge 1 commit into from

Conversation

indutny
Copy link
Member

@indutny indutny commented May 2, 2015

StreamBase::AfterWrite is passing handle as an argument to the
afterWrite function in net.js. Thus GC should not collect the handle
and the request separately and assume that they are tied together.

With this commit - request will always outlive the StreamBase instance,
helping us survive the GC pass.

Fix: #1580

`StreamBase::AfterWrite` is passing handle as an argument to the
`afterWrite` function in net.js. Thus GC should not collect the handle
and the request separately and assume that they are tied together.

With this commit - request will always outlive the StreamBase instance,
helping us survive the GC pass.

Fix: nodejs#1580
@ChALkeR
Copy link
Member

ChALkeR commented May 2, 2015

Works for me with #1580, didn't raise GC timings.

@bnoordhuis
Copy link
Member

LGTM. What about e.g. ShutdownWrap?

@mscdex mscdex added the net Issues and PRs related to the net subsystem. label May 2, 2015
indutny added a commit that referenced this pull request May 3, 2015
`StreamBase::AfterWrite` is passing handle as an argument to the
`afterWrite` function in net.js. Thus GC should not collect the handle
and the request separately and assume that they are tied together.

With this commit - request will always outlive the StreamBase instance,
helping us survive the GC pass.

Same applies to the ShutdownWrap instances, they should never be
collected after the StreamBase instance.

Fix: #1580
PR-URL: #1590
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@indutny
Copy link
Member Author

indutny commented May 3, 2015

Landed with ShutdownWrap fixes in b4f5898 . Thank you!

@indutny indutny closed this May 3, 2015
@indutny indutny deleted the fix/gh-1580 branch May 3, 2015 01:07
@rvagg rvagg mentioned this pull request May 4, 2015
Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request May 19, 2015
`StreamBase::AfterWrite` is passing handle as an argument to the
`afterWrite` function in net.js. Thus GC should not collect the handle
and the request separately and assume that they are tied together.

With this commit - request will always outlive the StreamBase instance,
helping us survive the GC pass.

Same applies to the ShutdownWrap instances, they should never be
collected after the StreamBase instance.

Fix: nodejs#1580
PR-URL: nodejs#1590
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@jesec jesec mentioned this pull request Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
net Issues and PRs related to the net subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants