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

src: fix StreamPipe cleanup & interaction with env handles #26256

Closed
wants to merge 2 commits into from

Conversation

@addaleax
Copy link
Member

commented Feb 21, 2019

src: do not access Environment-owned handles after cleanup

Do not access handles that have already begun to be closed
or are closed.

src: clean up StreamPipe in destructor

In the presence of Workers, it is not safe to assume that
StreamPipe::Unpipe() has been called at the time when the object
is destroyed.

Instead, clean up when the destructor is called.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
addaleax added 2 commits Feb 21, 2019
src: do not access Environment-owned handles after cleanup
Do not access handles that have already begun to be closed
or are closed.
src: clean up `StreamPipe` in destructor
In the presence of Workers, it is not safe to assume that
`StreamPipe::Unpipe()` has been called at the time when the object
is destroyed.

Instead, clean up when the destructor is called.
env->CloseHandle(handle, [](uv_handle_t* handle) {});
env->CloseHandle(handle, [](uv_handle_t* handle) {
#ifdef DEBUG
memset(handle, 0xab, uv_handle_size(handle->type));

This comment has been minimized.

Copy link
@joyeecheung
@addaleax

This comment has been minimized.

Copy link
Member Author

commented Feb 28, 2019

@addaleax

This comment has been minimized.

Copy link
Member Author

commented Mar 1, 2019

Landed in cb9d0ec, 08abb3b

@addaleax addaleax closed this Mar 1, 2019

@addaleax addaleax deleted the addaleax:worker-stream-pipe branch Mar 1, 2019

addaleax added a commit that referenced this pull request Mar 1, 2019
src: do not access Environment-owned handles after cleanup
Do not access handles that have already begun to be closed
or are closed.

PR-URL: #26256
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
addaleax added a commit that referenced this pull request Mar 1, 2019
src: clean up `StreamPipe` in destructor
In the presence of Workers, it is not safe to assume that
`StreamPipe::Unpipe()` has been called at the time when the object
is destroyed.

Instead, clean up when the destructor is called.

PR-URL: #26256
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
addaleax added a commit that referenced this pull request Mar 1, 2019
src: do not access Environment-owned handles after cleanup
Do not access handles that have already begun to be closed
or are closed.

PR-URL: #26256
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
addaleax added a commit that referenced this pull request Mar 1, 2019
src: clean up `StreamPipe` in destructor
In the presence of Workers, it is not safe to assume that
`StreamPipe::Unpipe()` has been called at the time when the object
is destroyed.

Instead, clean up when the destructor is called.

PR-URL: #26256
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@BridgeAR BridgeAR referenced this pull request Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.