On Thu, 2023-06-29 at 15:29 +0530, sreenivas somavarapu wrote:
> Hi Oleg,
> 
> The error message is misleading (See below). It looks like Actual
> error is because it is unable to acquire lock (From the exception
> provided earlier Line 27 of StrictConnPool.java). Timeout of 0 means
> don't wait as per java docs of ReentrantLock. So in my case it looks
> like already one thread acquired lock and another thread now trying
> to acquire lock and as TimeOut value is 0, that thread is returning
> back and causing that exception to be thrown. As per HTTPClient java
> docs a timeout of 0 to setConnectionRequestTimeout means infinite
> timeout.
> 
> Snippet from ReentrantLock java docs
> image.png
> 
> 
> Snippet from RequestConfig.Builder java docs
> image.png
> 
> Below code produces the same output as observed from HTTPClient logs
> provided earlier
>         Timeout requestTimeout = Timeout.ZERO_MILLISECONDS;
>         final Deadline deadline = Deadline.calculate(requestTimeout);
>         System.out.println(DeadlineTimeoutException.from(deadline));
> 
> Output
> org.apache.hc.core5.util.DeadlineTimeoutException: Deadline:
> +292278994-08-17T07:12:55.807+0000, 9223370348824198963 MILLISECONDS
> overdue
> 

I see the problem now. There is a bug in StrictConnPool that gets
masked by a bad error message generated by DeadlineTimeoutException. 

Please raise a JIRA for this defect.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to