Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

client: make destroy() always destroy the socket #1125

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

Open
justfalter wants to merge 1 commit into mscdex:master
base: master
Choose a base branch
Loading
from justfalter:always-destroy-client-socket

Conversation

@justfalter
Copy link

@justfalter justfalter commented Jan 28, 2022

If client.destroy() is called, always destroy the underlying socket so
that file descriptor is freed. This matches behavior of node's Socket and
Writable.

Previous behavior made this conditional on writability of the socket.
If the socket wasn't writable, then client.destroy() wouldn't actually
destroy the socket, the file descriptor would remain open, and the
node process would hang on exit.. It might timeout after 15 minutes, if
you're lucky.

fixes #1124

martin-randall-tanium reacted with hooray emoji
If client.destroy() is called, always destroy the underlying socket so
that file descriptor is freed. This matches behavior of node's Socket and
Writable.
Previous behavior made this conditional on writability of the socket.
If the socket wasn't writable, then client.destroy() wouldn't actually
destroy the socket, the file descriptor would remain open, and the
node process would hang on exit.. It might timeout after 15 minutes, if
you're lucky.
fixes mscdex#1124 
Copy link
Author

Note: Prior to this large refactor, client.destroy() wouldn't check to see if the socket was writable, it'd just destroy it. I ran into this issue after upgrading to 1.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@martin-randall-tanium martin-randall-tanium martin-randall-tanium approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Client.destroy() does not always destroy the socket, node hangs on exit

AltStyle によって変換されたページ (->オリジナル) /