You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Dropwizard 4 (Jersey 3.0.5) on Java 17. This problem exists in 3.0.12 as well.
When an HttpConnection transitions to ERROR from IDLE state, the connection gets closed but not removed from DestinationConnectionPool. This results in the next request failing regardless of whether the server has been restarted.
My guess is that cleanClosedConnection should be called at:
So, I've retried the described behavior.
The main difference I've got is:
When the server is being shut down between requests, the request that goes to nowhere results in the ERROR state but in the DestinationConnectionPool it hits the
case CONNECTING: {
removeAllPendingWithError(connection.getError());
return;
}
case because the oldState is CONNECTING thus the removeAllPendingWithError(connection.getError()); properly cleans all connections and the next request which runs to the already started server passes OK. Furthermore, the line in the DestinationConnectionPool you are referring to handles unexpected behavior by throwing the IllegalStateException("Illegal state transition, old state: " + oldState + " new state: " + newState); exception which terminates all connections in the flow instantly. I'm not sure, how it's possible to bypass the CONNECTING state from the IDLE. All my investigations resulted in the flow that defines the IDLE state as the primary and then in case of sending the request the flow goes to the CONNECTING state. If you have some special use case that somehow manages to violate this sequence please share it I'll try to make it impossible :)
I am using Dropwizard 4 (Jersey 3.0.5) on Java 17. This problem exists in 3.0.12 as well.
When an HttpConnection transitions to ERROR from IDLE state, the connection gets closed but not removed from DestinationConnectionPool. This results in the next request failing regardless of whether the server has been restarted.
My guess is that cleanClosedConnection should be called at:
jersey/connectors/jdk-connector/src/main/java/org/glassfish/jersey/jdk/connector/internal/DestinationConnectionPool.java
Line 287 in fc78757
The text was updated successfully, but these errors were encountered: