You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2018/01/02 10:42:34 UTC

[incubator-servicecomb-java-chassis] 05/05: SCB-126 fix pr comment

This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit f6da71462c5b909df55391116b6a6906ed46ff62
Author: zhengyangyong <ya...@huawei.com>
AuthorDate: Mon Jan 1 11:30:47 2018 +0800

    SCB-126 fix pr comment
    
    Signed-off-by: zhengyangyong <ya...@huawei.com>
---
 .../io/servicecomb/core/provider/consumer/InvokerUtils.java    | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/core/src/main/java/io/servicecomb/core/provider/consumer/InvokerUtils.java b/core/src/main/java/io/servicecomb/core/provider/consumer/InvokerUtils.java
index 3005ce1..3a9b310 100644
--- a/core/src/main/java/io/servicecomb/core/provider/consumer/InvokerUtils.java
+++ b/core/src/main/java/io/servicecomb/core/provider/consumer/InvokerUtils.java
@@ -87,12 +87,16 @@ public final class InvokerUtils {
       ReactiveResponseExecutor respExecutor = new ReactiveResponseExecutor();
       invocation.setResponseExecutor(respExecutor);
 
-      invocation.next(asyncResp);
+      AsyncResponse wrappedAsyncResponse = response -> {
+        invocation.triggerFinishedEvent();
+        asyncResp.handle(response);
+      };
+
+      invocation.next(wrappedAsyncResponse);
     } catch (Throwable e) {
+      invocation.triggerFinishedEvent();
       LOGGER.error("invoke failed, {}", invocation.getOperationMeta().getMicroserviceQualifiedName());
       asyncResp.consumerFail(e);
-    } finally {
-      invocation.triggerFinishedEvent();
     }
   }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>.