-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhanced fix for #5855 #5858
Enhanced fix for #5855 #5858
Conversation
Avoid the race on request queue size by enhancing Pool to track demand.
jetty-client/src/main/java/org/eclipse/jetty/client/AbstractConnectionPool.java
Outdated
Show resolved
Hide resolved
increment demand even if pool is at max size.
removed duplicate code to FutureConnection.
moved pending from Pool to AbstractConnectionPool
fixed javadoc
better atomic usage
updates from review: + always call tryCreate, now passing demanded to indicate if demand should be incremented + simplify demand > supply calculation + if not multiplexing reduce demand on connection failure. If multiplexing, failure will not decrease demand, so some additional connections may be created until supply catches up.
{ | ||
int connectionCount = getConnectionCount(); | ||
if (LOG.isDebugEnabled()) | ||
LOG.debug("Try creating connection {}/{} with {}/{} pending", connectionCount, getMaxConnectionCount(), getPendingConnectionCount(), maxPending); | ||
LOG.debug("Try creating connection {}/{} with {} pending", connectionCount, getMaxConnectionCount(), getPendingConnectionCount()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should log the boolean demanded
parameter.
revert to using destination queue size for demand
Fixed test
Fix from review
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@@ -30,6 +29,6 @@ public static Connection acquire(AbstractConnectionPool connectionPool, boolean | |||
|
|||
public static void tryCreate(AbstractConnectionPool connectionPool, int pending) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This helper is only used for testing, so its signature should have been changed to reflect the new ConnectionPool.tryCreate(boolean)
one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small nits, otherwise LGTM.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
6f14c1c
into
jetty-9.4.x-5855_httpclient_may_not_send_queued_request
Avoid the race on request queue size by enhancing Pool to track demand.