On Thu, 5 Feb 2026 11:14:54 GMT, Daniel Fuchs <[email protected]> wrote:

>> OK - this is because the OS specific timeout kicks in. So you might get a 
>> `ConnectException` if the timeout you provide to connect() exceeds the 
>> OS/platform specific timeout. Otherwise you get the 
>> `SocketTimeoutException`. In my experiment (from which I excluded windows), 
>> I never got to trigger the `ConnectException`. I was using a timeout of `250 
>> + Utils.adjustTimeout(250)`. It's OK to keep the `ConnectException` then. 
>> But I'm still wondering: does 5000 trigger the ConnectException?
>
> I'd expect the default OS specific connection timeout to be around 2 mins on 
> unix platforms. So if you pass a timeout that's largely lesser than that you 
> will practically never see the `ConnectException`. It may still happen if the 
> selector/poller thread is paused for too long, so it's good to cater for that.

> OK - this is because the OS specific timeout kicks in. So you might get a 
> `ConnectException` if the timeout you provide to connect() exceeds the 
> OS/platform specific timeout. Otherwise you get the `SocketTimeoutException`.

Could you explain this a little bit more, please? Because, in the Windows host 
JTreg log I privately shared with you, there is the `elapsed time (seconds): 
0.903` line. That is, `connect(..., 5000)` threw `ConnectionException` in less 
than 1s, which is less than both the timeout I provide (i.e., 5s) and the OS 
defaults to. Am I missing something?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29431#discussion_r2769318873

Reply via email to