You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2019/08/23 11:07:41 UTC

svn commit: r1865743 - /httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java

Author: olegk
Date: Fri Aug 23 11:07:41 2019
New Revision: 1865743

URL: http://svn.apache.org/viewvc?rev=1865743&view=rev
Log:
Bug fix: PipeliningClientExchangeHandlerImpl to fail result future in case of an execution failure

Modified:
    httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java

Modified: httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java?rev=1865743&r1=1865742&r2=1865743&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java (original)
+++ httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java Fri Aug 23 11:07:41 2019
@@ -145,16 +145,20 @@ class PipeliningClientExchangeHandlerImp
 
     @Override
     void executionFailed(final Exception ex) {
-        final HttpAsyncRequestProducer requestProducer = this.requestProducerRef.get();
-        if (requestProducer != null) {
-            requestProducer.failed(ex);
-        }
-        final HttpAsyncResponseConsumer<T> responseConsumer = this.responseConsumerRef.get();
-        if (responseConsumer != null) {
-            responseConsumer.failed(ex);
-        }
-        for (final HttpAsyncResponseConsumer<T> cancellable: this.responseConsumerQueue) {
-            cancellable.cancel();
+        try {
+            final HttpAsyncRequestProducer requestProducer = this.requestProducerRef.get();
+            if (requestProducer != null) {
+                requestProducer.failed(ex);
+            }
+            final HttpAsyncResponseConsumer<T> responseConsumer = this.responseConsumerRef.get();
+            if (responseConsumer != null) {
+                responseConsumer.failed(ex);
+            }
+            for (final HttpAsyncResponseConsumer<T> cancellable: this.responseConsumerQueue) {
+                cancellable.cancel();
+            }
+        } finally {
+            this.resultFuture.failed(ex);
         }
     }
 



Re: svn commit: r1865743 - /httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java

Posted by sebb <se...@gmail.com>.
See https://issues.apache.org/jira/browse/INFRA-16738
for reason why that SVN tree was left RW

On Fri, 23 Aug 2019 at 12:11, Gary Gregory <ga...@gmail.com> wrote:
>
> Svn?
>
> Gary
>
> On Fri, Aug 23, 2019, 07:07 <ol...@apache.org> wrote:
>
> > Author: olegk
> > Date: Fri Aug 23 11:07:41 2019
> > New Revision: 1865743
> >
> > URL: http://svn.apache.org/viewvc?rev=1865743&view=rev
> > Log:
> > Bug fix: PipeliningClientExchangeHandlerImpl to fail result future in case
> > of an execution failure
> >
> > Modified:
> >
> > httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java
> >
> > Modified:
> > httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java
> > URL:
> > http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java?rev=1865743&r1=1865742&r2=1865743&view=diff
> >
> > ==============================================================================
> > ---
> > httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java
> > (original)
> > +++
> > httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java
> > Fri Aug 23 11:07:41 2019
> > @@ -145,16 +145,20 @@ class PipeliningClientExchangeHandlerImp
> >
> >      @Override
> >      void executionFailed(final Exception ex) {
> > -        final HttpAsyncRequestProducer requestProducer =
> > this.requestProducerRef.get();
> > -        if (requestProducer != null) {
> > -            requestProducer.failed(ex);
> > -        }
> > -        final HttpAsyncResponseConsumer<T> responseConsumer =
> > this.responseConsumerRef.get();
> > -        if (responseConsumer != null) {
> > -            responseConsumer.failed(ex);
> > -        }
> > -        for (final HttpAsyncResponseConsumer<T> cancellable:
> > this.responseConsumerQueue) {
> > -            cancellable.cancel();
> > +        try {
> > +            final HttpAsyncRequestProducer requestProducer =
> > this.requestProducerRef.get();
> > +            if (requestProducer != null) {
> > +                requestProducer.failed(ex);
> > +            }
> > +            final HttpAsyncResponseConsumer<T> responseConsumer =
> > this.responseConsumerRef.get();
> > +            if (responseConsumer != null) {
> > +                responseConsumer.failed(ex);
> > +            }
> > +            for (final HttpAsyncResponseConsumer<T> cancellable:
> > this.responseConsumerQueue) {
> > +                cancellable.cancel();
> > +            }
> > +        } finally {
> > +            this.resultFuture.failed(ex);
> >          }
> >      }
> >
> >
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: svn commit: r1865743 - /httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java

Posted by Gary Gregory <ga...@gmail.com>.
Svn?

Gary

On Fri, Aug 23, 2019, 07:07 <ol...@apache.org> wrote:

> Author: olegk
> Date: Fri Aug 23 11:07:41 2019
> New Revision: 1865743
>
> URL: http://svn.apache.org/viewvc?rev=1865743&view=rev
> Log:
> Bug fix: PipeliningClientExchangeHandlerImpl to fail result future in case
> of an execution failure
>
> Modified:
>
> httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java
>
> Modified:
> httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java
> URL:
> http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java?rev=1865743&r1=1865742&r2=1865743&view=diff
>
> ==============================================================================
> ---
> httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java
> (original)
> +++
> httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/PipeliningClientExchangeHandlerImpl.java
> Fri Aug 23 11:07:41 2019
> @@ -145,16 +145,20 @@ class PipeliningClientExchangeHandlerImp
>
>      @Override
>      void executionFailed(final Exception ex) {
> -        final HttpAsyncRequestProducer requestProducer =
> this.requestProducerRef.get();
> -        if (requestProducer != null) {
> -            requestProducer.failed(ex);
> -        }
> -        final HttpAsyncResponseConsumer<T> responseConsumer =
> this.responseConsumerRef.get();
> -        if (responseConsumer != null) {
> -            responseConsumer.failed(ex);
> -        }
> -        for (final HttpAsyncResponseConsumer<T> cancellable:
> this.responseConsumerQueue) {
> -            cancellable.cancel();
> +        try {
> +            final HttpAsyncRequestProducer requestProducer =
> this.requestProducerRef.get();
> +            if (requestProducer != null) {
> +                requestProducer.failed(ex);
> +            }
> +            final HttpAsyncResponseConsumer<T> responseConsumer =
> this.responseConsumerRef.get();
> +            if (responseConsumer != null) {
> +                responseConsumer.failed(ex);
> +            }
> +            for (final HttpAsyncResponseConsumer<T> cancellable:
> this.responseConsumerQueue) {
> +                cancellable.cancel();
> +            }
> +        } finally {
> +            this.resultFuture.failed(ex);
>          }
>      }
>
>
>
>