Repository navigation
Conversation
wilkinsona
left a comment
There was a problem hiding this comment.
Thanks for the PR.
I don't think doubling the purpose of the socket timeout and applying it as the response timeout is the right thing to do. Presumably, the Elasticsearch client code uses an infinite timeout by default for a reason. Any change we make in Boot should allow someone to tune the socket timeout without inadvertently overriding that default.
If a change is warranted here, I think we should introduce a separate property so that the different settings in the HTTP 5 Client remain separated in Boot's configuration.
|
Thanks for the review. That makes sense, and keeping the client's default unless someone opts in is better than what I did here. How about a new |
|
Thanks, @beyondwin. The proposed property ( |
Rest5ClientBuilder sets the request config's response timeout to 0 (infinite), which HttpClient 5 uses in place of the connection's socket timeout while a request is executing. A node that accepts the connection but never responds therefore blocks callers of the auto-configured Rest5Client, including the health indicator, indefinitely, and changing that requires a Rest5ClientBuilderCustomizer. This commit adds a spring.elasticsearch.response-timeout property that is mapped to the request config's response timeout. When it is not set, the client's default is kept. Signed-off-by: WooSeung Kim <wooseung.dev@gmail.com>
3844001 to
f07fa00
Compare
|
Thanks, I've reworked the PR to add |
Rest5ClientBuilder sets the request config's response timeout to 0
(infinite), which HttpClient 5 uses in place of the connection's
socket timeout while a request is executing. A node that accepts the
connection but never responds therefore blocks callers of the
auto-configured Rest5Client, including the health indicator,
indefinitely, and changing that requires a Rest5ClientBuilderCustomizer.
This commit adds a spring.elasticsearch.response-timeout property that
is mapped to the request config's response timeout. When it is not
set, the client's default is kept.