-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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 setting for tcp_keepalive for oidc back-channel #87868
Add setting for tcp_keepalive for oidc back-channel #87868
Conversation
This PR adds a new setting to enable tcp keepalive probes for the connections used by the oidc back-channel communication. It defaults to false to keep the existing behaviour. Relates: elastic#87773
Hi @ywangd, I've created a changelog YAML for you. |
NOTE: This is currently a draft PR because:
|
...c/main/java/org/elasticsearch/xpack/core/security/authc/oidc/OpenIdConnectRealmSettings.java
Outdated
Show resolved
Hide resolved
ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor( | ||
IOReactorConfig.custom().setSoKeepAlive(realmConfig.getSetting(HTTP_TCP_KEEP_ALIVE)).build() | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no easy way to test this setting. Other than invasive reflection, one possibility is to subclass DefaultConnectingIOReactor
and override the prepareSocket
method where we can assert the socket configuration. It feels heavy weighted for testing though. We may need the subclass in production if we decide to support for configuring keepalive_time, interval etc in future. So I think we can save the test till we actually need that in production.
Pinging @elastic/es-security (Team:Security) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to at least confirm manually that this does enable keepalives on the connection (e.g. using ss -toe
). I expect it does so this LGTM.
If we were to do something like #84653 then we could check this timer directly in a test (at least on Linux).
Thanks for the tip. I manually verified it and it worked: Before
After
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pending fixed typo in docs.
Co-authored-by: Tim Vernum <[email protected]>
@elasticmachine update branch |
This PR adds a new setting to enable tcp keepalive probes for the
connections used by the oidc back-channel communication. It defaults to
true as tcp keepalive is generally useful for ES.
Relates: #87773