public class OperationTimedOutException extends ConnectionException
SocketOptions.getReadTimeoutMillis().
When the exception is thrown from the request execution path it carries additional diagnostic
fields: the driver-side timeout that was configured for the request, the number of in-flight
requests on the connection at the moment of the timeout, and the pool-level pending-borrow queue
depth and total in-flight count. These fields are set to UNAVAILABLE when the exception
was not created through that path (e.g. when re-thrown or copied via legacy constructors).
| Modifier and Type | Field and Description |
|---|---|
static int |
UNAVAILABLE
Sentinel value returned by
getConfiguredTimeoutMs(), getConnectionInFlight(),
getPoolPendingBorrows(), and getPoolTotalInFlight() when the corresponding
information was not available at the time the exception was created. |
| Constructor and Description |
|---|
OperationTimedOutException(EndPoint endPoint) |
OperationTimedOutException(EndPoint endPoint,
long configuredTimeoutMs,
int connectionInFlight,
int poolPendingBorrows,
int poolTotalInFlight)
Creates an exception with full diagnostic context captured at timeout time.
|
OperationTimedOutException(EndPoint endPoint,
String msg) |
OperationTimedOutException(EndPoint endPoint,
String msg,
Throwable cause) |
| Modifier and Type | Method and Description |
|---|---|
OperationTimedOutException |
copy()
Copy the exception.
|
long |
getConfiguredTimeoutMs()
Returns the driver-side read timeout that was configured for the request, in milliseconds, or
UNAVAILABLE if not available. |
int |
getConnectionInFlight()
Returns the number of in-flight requests on the connection at the time of the timeout, or
UNAVAILABLE if not available. |
int |
getPoolPendingBorrows()
Returns the number of requests waiting to acquire a connection from the pool at the time of the
timeout, or
UNAVAILABLE if not available. |
int |
getPoolTotalInFlight()
Returns the total number of in-flight requests across all connections to the host at the time
of the timeout, or
UNAVAILABLE if not available. |
getAddress, getEndPoint, getHost, getMessageaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic static final int UNAVAILABLE
getConfiguredTimeoutMs(), getConnectionInFlight(),
getPoolPendingBorrows(), and getPoolTotalInFlight() when the corresponding
information was not available at the time the exception was created.public OperationTimedOutException(EndPoint endPoint)
public OperationTimedOutException(EndPoint endPoint, String msg, Throwable cause)
public OperationTimedOutException(EndPoint endPoint, long configuredTimeoutMs, int connectionInFlight, int poolPendingBorrows, int poolTotalInFlight)
endPoint - the host that was being queried.configuredTimeoutMs - the driver-side read timeout that was in effect for this request, in
milliseconds. Either the per-statement override (Statement.setReadTimeoutMillis(int)) or the driver-wide value from
SocketOptions.getReadTimeoutMillis().connectionInFlight - the number of in-flight requests on the connection at the time of the
timeout.poolPendingBorrows - the number of requests waiting to acquire a connection from the pool
at the time of the timeout. A non-zero value indicates pool contention.poolTotalInFlight - the total number of in-flight requests across all connections to this
host at the time of the timeout.public long getConfiguredTimeoutMs()
UNAVAILABLE if not available.public int getConnectionInFlight()
UNAVAILABLE if not available.public int getPoolPendingBorrows()
UNAVAILABLE if not available. A non-zero value indicates that requests
were queued inside the driver before reaching the server.public int getPoolTotalInFlight()
UNAVAILABLE if not available.public OperationTimedOutException copy()
DriverExceptionThis returns a new exception, equivalent to the original one, except that because a new object is created in the current thread, the top-most element in the stacktrace of the exception will refer to the current thread (this is mainly intended for internal use by the driver). The cause of the copied exception will be the original exception.
copy in class ConnectionExceptionCopyright © 2012–2026. All rights reserved.