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

Remove the SO_LINGER option #1127

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Remove the SO_LINGER option #1127

merged 1 commit into from
Jan 20, 2025

Conversation

jrajahalme
Copy link
Member

@jrajahalme jrajahalme commented Jan 17, 2025

SO_LINGER option makes the close() system call block if there is any unfinished business on the socket, even if the socket is set to the non-blocking mode. Any blocking is at odds with Envoy's threading model, and we have seen non-zero Envoy watchdog mege miss metrics corroborated by Envoy trace logs indicating that a close system call was blocking for 10 seconds, exactly the time we had set for the SO_LINGER option.

Fix this by removing the setting of the linger option.

Due to the different code structure v1.31 version is in a separate PR: #1128

SO_LINGER option makes the close() system call block if there is any
unfinished business on the socket, even if the socket is set to the
non-blocking mode. Any blocking is at odds with Envoy's threading model,
and we have seen non-zero Envoy watchdog mege miss metrics corroborated
by Envoy trace logs indicating that a close system call was blocking for
10 seconds, exactly the time we had set for the SO_LINGER option.

Fix this by removing the setting of the linger option.

Signed-off-by: Jarno Rajahalme <[email protected]>
@jrajahalme jrajahalme added the bug Something isn't working label Jan 17, 2025
@jrajahalme jrajahalme requested a review from a team as a code owner January 17, 2025 22:48
@jrajahalme jrajahalme requested review from sayboras and mhofstetter and removed request for sayboras January 17, 2025 22:48
@sayboras sayboras merged commit 5f42e7a into main Jan 20, 2025
5 checks passed
@sayboras sayboras deleted the eliminate-so-linger branch January 20, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants