Skip to content

Add server shutdown to close listeners on migration exit#8

Open
dnovitski wants to merge 1 commit into
masterfrom
fix/server-lifecycle
Open

Add server shutdown to close listeners on migration exit#8
dnovitski wants to merge 1 commit into
masterfrom
fix/server-lifecycle

Conversation

@dnovitski

Copy link
Copy Markdown
Owner

Summary

Fix server listener leak: Accept loops and listeners are never closed when migration completes.

Changes

  • Add Close() method to Server that closes both unix and TCP listeners
  • Call server.Close() via defer in both Migrate() and Revert() paths
  • Fix Accept loops to return on listener close instead of logging errors in a tight loop

Impact

Previously, every migration with --serve-socket-file or --serve-tcp-port left goroutines blocked in Accept() and leaked file descriptors until process exit.

- Add Close() method to Server to close unix and TCP listeners
- Call server.Close() via defer alongside RemoveSocketFile() in both
  Migrate() and Revert() paths
- Fix Accept loops to exit cleanly when listener is closed instead
  of logging errors in a tight loop

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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