ok2c commented on a change in pull request #137: HTTPCORE-589 Fix LaxConnPool
to ensure pending requests assigned connections
URL:
https://github.com/apache/httpcomponents-core/pull/137#discussion_r314207152
##########
File path: httpcore5/src/main/java/org/apache/hc/core5/pool/LaxConnPool.java
##########
@@ -392,17 +395,17 @@ public void shutdown(final CloseMode closeMode) {
}
}
- private boolean allocatePoolEntry() {
+ private PoolEntry<T, C> createPoolEntry() {
final int poolmax = max;
int prev, next;
do {
prev = allocated.get();
next = (prev<poolmax)? prev+1 : prev;
} while (!allocated.compareAndSet(prev, next));
- return prev < next;
+ return (prev < next)? new PoolEntry<T,C>(route, timeToLive) : null;
}
- private void deallocatePoolEntry() {
+ private void disposePoolEntry(final PoolEntry<T, C> entry) {
Review comment:
@coxlinton I half suspected that as being the reason. I fully understand
your desire to have a pair of symmetric allocation / deallocation methods.
However, at present it just makes things more confusing. Those methods are not
API visible and can be changed at point it becomes warranted. For now I would
even go as far as removing `disposePoolEntry` and calling
`allocated.decrementAndGet()` directly.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]