Class OperationTimedOutException

  • All Implemented Interfaces:
    CoordinatorException, Serializable

    public class OperationTimedOutException
    extends ConnectionException
    Thrown on a client-side timeout, i.e. when the client didn't hear back from the server within 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).

    See Also:
    Serialized Form
    • Constructor Detail

      • OperationTimedOutException

        public OperationTimedOutException​(EndPoint endPoint)
      • OperationTimedOutException

        public OperationTimedOutException​(EndPoint endPoint,
                                          String msg)
      • OperationTimedOutException

        public OperationTimedOutException​(EndPoint endPoint,
                                          String msg,
                                          Throwable cause)
      • OperationTimedOutException

        public OperationTimedOutException​(EndPoint endPoint,
                                          long configuredTimeoutMs,
                                          int connectionInFlight,
                                          int poolPendingBorrows,
                                          int poolTotalInFlight)
        Creates an exception with full diagnostic context captured at timeout time.
        Parameters:
        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.
    • Method Detail

      • getConfiguredTimeoutMs

        public long getConfiguredTimeoutMs()
        Returns the driver-side read timeout that was configured for the request, in milliseconds, or UNAVAILABLE if not available.
      • getConnectionInFlight

        public int getConnectionInFlight()
        Returns the number of in-flight requests on the connection at the time of the timeout, or UNAVAILABLE if not available.
      • getPoolPendingBorrows

        public 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. A non-zero value indicates that requests were queued inside the driver before reaching the server.
      • getPoolTotalInFlight

        public 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.
      • copy

        public OperationTimedOutException copy()
        Description copied from class: DriverException
        Copy the exception.

        This 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.

        Overrides:
        copy in class ConnectionException
        Returns:
        a copy/clone of this exception.