Skip to content

Conversation

norio-nomura
Copy link
Contributor

@norio-nomura norio-nomura commented Sep 11, 2025

*_ep.sock, *_fd.sock, and *_qemu.sock will be properly removed on exit with the following changes:

  • Pass signal.NotifyContext to usernet.StartGVisorNetstack.
  • Close http.Server instead of net.Listener.
  • Fix mishandling of checking http.ErrServerClosed.
  • Check ctx.Done() outside of the loop calling listener.Accept() in listenFD, and listenQEMU.
  • Use errors.Is(err, net.ErrClosed) in UDPFileConn.Read.
    Since net: errClosing not exported golang/go#4373 has been fixed.

`*_ep.sock`, `*_fd.sock`, and `*_qemu.sock` will be properly removed on exit with the following changes:
- Pass `signal.NotifyContext` to `usernet.StartGVisorNetstack`.
- Close `http.Server` instead of `net.Listener`.
- Fix mishandling of checking `http.ErrServerClosed`.
- Check `ctx.Done()` outside of the loop calling `listener.Accept()` in `listenFD`, and `listenQEMU`.
- Use `errors.Is(err, net.ErrClosed)` in `UDPFileConn.Read`.
  Since golang/go#4373 has been fixed.

Signed-off-by: Norio Nomura <[email protected]>
@norio-nomura norio-nomura force-pushed the close-usernet-on-signal branch from 787faa9 to 021f8a2 Compare September 12, 2025 01:25
@AkihiroSuda AkihiroSuda added this to the v2.0.0 milestone Sep 17, 2025
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit d645d87 into lima-vm:master Sep 17, 2025
62 of 63 checks passed
@norio-nomura norio-nomura deleted the close-usernet-on-signal branch September 17, 2025 07:47
@norio-nomura
Copy link
Contributor Author

Thanks! 🙏🏻

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