Skip to content

Fix UDPSocket not being closed when VM destructs - #18687

Closed
190n wants to merge 21 commits into
mainfrom
ben/udp
Closed

190n wants to merge 21 commits into
mainfrom
ben/udp

Conversation

@190n

@190n 190n commented Mar 31, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes lifetime bugs in the UDPSocket implementation. In particular, the socket would not be closed if the VM exited before it was garbage collected. This means file descriptors would leak if worker threads are rapidly created and open UDP sockets.

TODOs before merging:

  • fix the objects not getting GC'd until VM exits
  • rebase this on main once the branch ben/workers is merged

How did you verify your code works?

TODO (this probably deserves new tests)

@robobun

robobun commented Mar 31, 2025 •

Copy link
Copy Markdown
Collaborator
Updated 4:31 PM PT - Mar 31st, 2025

❌ @190n, your commit 2f2b530 has 2 failures in Build #14317:


🧪   try this PR locally:

bunx bun-pr 18687

@190n 190n mentioned this pull request Apr 3, 2025
4 tasks
Base automatically changed from ben/workers to main April 8, 2025 12:29
@190n 190n closed this Mar 16, 2026
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.

2 participants