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

Add exponential backoff to socket accept #46

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

faern
Copy link
Member

@faern faern commented Oct 3, 2023

In certain odd scenarios the tcp2udp process on our WireGuard servers run out of file descriptors. Then it busy loops on the TCP accept call. Because accepting the socket fails, but it's left in the TCP accept queue, so it will try accepting the same socket again in next iteration.

A crude solution to this is just to sleep between failed TCP accepts with a simple exponential backoff.

This PR supersedes #44


This change is Reviewable

@faern faern requested review from dlon and mvd-ows October 3, 2023 15:15
@faern faern force-pushed the add-exponential-backoff-to-socket-accept branch from e11e82d to 62e9694 Compare October 3, 2023 15:15
Copy link
Member

@dlon dlon left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @faern)

@faern faern merged commit 233f170 into main Oct 5, 2023
12 checks passed
@faern faern deleted the add-exponential-backoff-to-socket-accept branch October 5, 2023 12:15
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.

3 participants