Skip to content

fix: clean up handles in worker_threads environments to prevent aborting #35

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

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

oyyd
Copy link
Member

@oyyd oyyd commented Oct 16, 2024

When using in worker_threads Workers, Node.js will abort with messages like:

uv loop at [0x00000000] has open handles...

when workers are exiting or are terminated with active DgramSocket or SeqpacketSocket.

To fix this issue, we need clean up all active uv_handles in hooks registered by napi_add_env_cleanup_hook.

@oyyd oyyd force-pushed the feat/oyyd branch 2 times, most recently from 7b00788 to 88a1765 Compare October 17, 2024 07:14
@oyyd oyyd changed the title WIP fix: clean up handles in worker_threads environments to prevent aborting fix: clean up handles in worker_threads environments to prevent aborting Oct 17, 2024
When using in `worker_threads` Workers, Node.js will abort with messages like:

```
uv loop at [0x00000000] has open handles...
```

when workers are exiting or are terminated with active `DgramSocket` or `SeqpacketSocket`.

To fix this issue, we need clean up all active uv_handles in hooks registered by `napi_add_env_cleanup_hook`.
@oyyd oyyd merged commit d098554 into master Oct 17, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant