cwildman opened a new pull request #163: Allow for timeout while acquiring lock 
in StrictConnPool.
URL: https://github.com/apache/httpcomponents-core/pull/163
 
 
   I mentioned in the mailing list that a connection request does not fail 
immediately when the time to acquire the StrictConnPool lock is longer than the 
requestTimeout. Instead it will only fail when the lock is finally acquired and 
the deadline is checked in processPendingRequest(). @ok2c agreed and suggested 
I propose a PR.
   
   This PR changes StrictConnPool.lease to use the requestTimeout when 
attempting to grab the lock. If the lock can't be acquired within the timeout 
the request is failed with a DeadlineTimeoutException.
   
   A few comments:
   
   1. tryLock(timeout) is interruptible whereas lock() is not. I'm unclear if 
this would break any existing behavior.
   2. I don't love that acquisition of the lock is captured in a boolean, it 
feels slightly dangerous if this block gets more complex down the road. However 
I chose this over nested try catches since we need to handle the 
InterruptedException.
   
   

----------------------------------------------------------------
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]

Reply via email to