You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Rob Griffin <Ro...@quest.com> on 2017/04/04 02:44:04 UTC
BasicFuture get() implementation doesn't handle cancellation
Hi,
The Javadoc for Future.get() states:
V get() throws InterruptedException, ExecutionException, TimeoutException
Waits if necessary for the computation to complete, and then retrieves its result.
Returns:
the computed result
Throws:
CancellationException - if the computation was cancelled
ExecutionException - if the computation threw an exception
InterruptedException - if the current thread was interrupted while waiting
But when I look at the implementation of the get method in org.apache.http.concurrent.BasicFuture it doesn't throw a CancellationException which seems wrong to me. Sure I can call isCancelled() after get() returns but I shouldn't need to.
Regards,
Rob Griffin
Software Analyst, Spotlight Enterprise
Quest | R&D
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: BasicFuture get() implementation doesn't handle cancellation
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2017-04-04 at 02:44 +0000, Rob Griffin wrote:
> Hi,
>
> The Javadoc for Future.get() states:
>
> V get() throws InterruptedException, ExecutionException,
> TimeoutException
>
> Waits if necessary for the computation to complete, and then
> retrieves its result.
>
> Returns:�
> the computed result�
> Throws:�
> CancellationException - if the computation was
> cancelled�
> ExecutionException - if the computation threw an
> exception�
> InterruptedException - if the current thread was
> interrupted while waiting�
>
> But when I look at the implementation of the get method in
> org.apache.http.concurrent.BasicFuture it doesn't throw a
> CancellationException which seems wrong to me. Sure I can call
> isCancelled() after get() returns but I shouldn't need to.�
>
Please raise a JIRA for this defect.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org