HTTPCLIENT-2386: Classic transport to use connect timeout as a default if TLS timeout has not been explicitly set#699
Merged
Conversation
Member
|
👍 I think this will help a lot of users that get confused by what timeout kicks in when. |
rschmitt
reviewed
Aug 6, 2025
rschmitt
left a comment
Contributor
There was a problem hiding this comment.
Where is the original soTimeout restored after the handshake is completed?
…t if TLS timeout has not been explicitly set
Member
Author
@rschmitt Good catch. Please do another pass. |
Member
Author
|
@rschmitt Any objections to committing this change-set? |
rschmitt
approved these changes
Aug 10, 2025
| if (LOG.isDebugEnabled()) { | ||
| LOG.debug("{} {} connected {}->{}", ConnPoolSupport.getId(conn), endpointHost, conn.getLocalAddress(), conn.getRemoteAddress()); | ||
| } | ||
| conn.setSocketTimeout(soTimeout); |
Contributor
There was a problem hiding this comment.
I'm not sure what this does, since we set the socket timeout directly on the socket (with a null check) on line 191.
Comment on lines
+233
to
+237
| socket.setSoTimeout(handshakeTimeout.toMillisecondsIntBound()); | ||
| } | ||
| final SSLSocket sslSocket = tlsSocketStrategy.upgrade(socket, tlsName.getHostName(), tlsName.getPort(), attachment, context); | ||
| conn.bind(sslSocket, socket); | ||
| socket.setSoTimeout(soTimeout); |
Contributor
There was a problem hiding this comment.
I think this is much clearer than before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change-set re-aligns the behavior of the classic and async connection operators and makes both transports use connect timeout as a fallback value for the TLS timeout when explicitly set.