Skip to content
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

Ensure the standalone CS listener on Linux uses the SO_REUSEADDR socket option #8181

Merged
merged 1 commit into from
Jul 13, 2024

Conversation

dyemanov
Copy link
Member

@dyemanov dyemanov commented Jul 12, 2024

In recent FB versions Classic on Linux uses its native listener instead of xinetd/systemd. While we usually don't expect it to crash, it's still possible. However, often it cannot continue listening the port immediately after restart because the port is still in the FIN_WAIT state and the SO_REUSEADDR socket option is not used by the standalone Classic listener, thus causing "address already in use" errors during startup. This patch ensures that any kind of listeners (SS/SC using SRVR_multi_thread and CS standalone server) uses the SO_REUSEADDR option to avoid the issue.

Maybe (after this patch) we should also cleanup the retry loop for INET_ADDR_IN_USE used later in this function, as it's likely to be pointless, but I leave it for another day.

@dyemanov dyemanov self-assigned this Jul 12, 2024
@dyemanov dyemanov changed the title Ensure the CS listener uses the SO_REUSEADDR socket option Ensure the standalone CS listener on Linux uses the SO_REUSEADDR socket option Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants