jira-importer opened a new issue, #1086:
URL: https://github.com/apache/httpcomponents-core/issues/1086

   **[Linton 
Miller](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=linton.miller)**
 opened 
**[HTTPCORE-593](https://issues.apache.org/jira/browse/HTTPCORE-593?redirect=false)**
 and commented
   
   LaxConnPool may assign an available connection to a new lease request even 
though it has pending requests already queued. Though the class makes no 
guarantees of fairness, it doesn't require a major change to check if there are 
already queued requests before attempt to allocate a connection to the new 
lease. This still wouldn't establish any fairness guarantee, but would improve 
general fairness behaviour (presuming that is a desirable thing :)).
   
   Indeed, the code already partially has such a test, only creating new pool 
entries to fulfill the lease if the pending queue is empty:
               PoolEntry<T, C> entry = getAvailableEntry(state);
               if (entry == null && pending.isEmpty()) {
                   entry = createPoolEntry();
   The change would be just to move the pending test to prior to the entire 
allocation process.
   
   This fairness does come at the price of the (small) extra expense of the 
pending queue test on every lease (as opposed to just some of them). It could 
be that it's preferable to maintain absolute maximum performance for lease when 
there are available connections.
   
   
   ---
   
   **Affects:** 5.0-beta8
   
   **Remote Links:**
   - [GitHub Pull Request `#141`
   ](https://github.com/apache/httpcomponents-core/pull/141)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to