Re: socketTimeout uses double the value?
Hi Etienne,
What you are observing is expected behavior and can look like the configured socketTimeout is being "doubled," but what's happening is that the driver may block on socket reads in two distinct phases:
- During query execution (waiting for the server response).
- During connection cleanup/close after the timeout. When TLS is enabled, closing the connection involves a graceful TLS shutdown, which requires reading from the socket and is therefore also subject to the same read timeout.
You can see this by setting `socketTimeout=2000` and running a query such as `SELECT SLEEP(3)`. The query read will time out at ~2 seconds, and then the subsequent close/cleanup path blocks briefly while completing TLS shutdown—potentially adding additional elapsed time before the exception is surfaced/logged. Depending on timing (e.g., the server finishing the response while the client is closing), this additional delay may be shorter than a full timeout, but it can still make the total observed time exceed the configured `socketTimeout`.
If you disable TLS (`sslMode=DISABLED`), the close path does not incur the same additional blocking behavior, since the TLS shutdown semantics are not involved. This is consistent with how Java TLS sockets behave during graceful shutdown.
The exception message reflects the total elapsed time for the operation including cleanup.
Please consult the bug report for follow-up.
Subject
Written By
Posted
February 10, 2026 02:23PM
February 19, 2026 06:08AM
Re: socketTimeout uses double the value?
February 22, 2026 01:44PM
February 23, 2026 06:45AM
Sorry, only registered users may post in this forum.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.