[
https://issues.apache.org/jira/browse/HTTPCLIENT-1314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oleg Kalnichevski resolved HTTPCLIENT-1314.
-------------------------------------------
Resolution: Duplicate
> Deadlock in http.client.fluent.Async.ExecRunnable.run() if there is an
> exception in FutureCallback
> --------------------------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-1314
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1314
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.2.3, 4.3 Alpha1
> Environment: Windows 7 64bits
> Reporter: Andrey P
> Labels: fluent, httpclient
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> Deadlock in http.client.fluent.Async.ExecRunnable.run() if an exception is
> thrown in FutureCallback.completed()
> Look at the <<<http.client.fluent.Async.ExecRunnable.run()>>> method:
> public void run() {
> try {
> Response response = this.executor.execute(this.request);
> T result = response.handleResponse(this.handler);
> this.future.completed(result);
> } catch (Exception ex) {
> **** this is never called because the BasicFuture.completed flag is set to
> true BEFORE the callback invocation
> **** (see below)
> this.future.failed(ex);
> }
> }
> <<<http.concurrent.BasicFuture>>>
> public synchronized boolean completed(final T result) {
> if (this.completed) {
> return false;
> }
> this.completed = true;
> this.result = result;
> if (this.callback != null) {
> this.callback.completed(result);
> }
> *** not executed if an exception in the callback.completed()
> notifyAll();
> return true;
> }
> public synchronized boolean failed(final Exception exception) {
> if (this.completed) {
> return false;
> }
> *** the following can't be reached if there is an exception in
> this.callback.completed() so that
> *** BasicFuture.get() waits forever
> this.completed = true;
> this.ex = exception;
> if (this.callback != null) {
> this.callback.failed(exception);
> }
> notifyAll();
> return true;
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]