Skip to content

fix: Add limited ref lifetime of incoming.socket attached to body: Readable#28

Merged
kitten merged 3 commits intomainfrom
@kitten/chore/limit-ref-lifetime
Feb 3, 2026
Merged

fix: Add limited ref lifetime of incoming.socket attached to body: Readable#28
kitten merged 3 commits intomainfrom
@kitten/chore/limit-ref-lifetime

Conversation

@kitten
Copy link
Copy Markdown
Owner

@kitten kitten commented Feb 3, 2026

Summary

Reattach the socket with incoming.socket.ref() when the body is being read, and unref it again when the body is closed.

@kitten kitten merged commit 37ff223 into main Feb 3, 2026
6 checks passed
@github-actions github-actions bot mentioned this pull request Feb 3, 2026
kitten added a commit to expo/expo that referenced this pull request Feb 3, 2026
# Why

In some scripts, `@vonovak` found that the main `untar` loop can leave the
Node.js process without active handles and terminate early. It's tricky
to reproduce, and I haven't been able to find this case yet. In theory,
there should be other handles keeping the process open due to file IO
work or the stack not being emptied in the same tick.

However, the bump in version adds a patch that keeps the
`incoming.socket` refed, since that's a reliable second way for there to
be a guaranteed active resource for Node, and should have no negative
consequences in cases where this is redundant.
kitten/fetch-nodeshim#28

# How

- Bump to `fetch-nodeshim@^0.4.4`
- **Note:** Other lockfile changes are because #42827 wasn't sufficient.
The lockfile wasn't only misaligned with the install, but needed another
install after a first dedup, which our postinstall doesn't do

# Test Plan

- n/a

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
-->

- [x] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
@kitten kitten deleted the @kitten/chore/limit-ref-lifetime branch February 16, 2026 03:17
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