cartridge-java icon indicating copy to clipboard operation
cartridge-java copied to clipboard

Do not fail the request with TimeoutException if a connection is failed and there are available connections

Open akudiyar opened this issue 3 years ago • 0 comments

Currently, when a connection fails (a disconnect event is emitted by netty), all in-flight requests for this connection that have not received a response yet will fail with TimeoutException, when the configured request timeout exceeds.

This may cause some requests to wait unnecessarily for the timeout when it is already known that the server will not respond. In this case, we may either end these requests immediately on disconnect event or repeat these requests internally, switching them to the other alive connections.

The first variant seems better, since the requests may not be idempotent, and the decision for repeating the request lies on the user.

akudiyar avatar Mar 02 '21 15:03 akudiyar