yiayiao opened a new issue, #3956:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3956

   版本:1.3.10
   
业务为REST接口,非Reactive模式,业务调用三方接口为Reactive模式,调用三方结束后,通过CompletableFuture的get方法获取三方调用结果后返回。
   
问题发生的场景为压测的过程中,三方未扩容,最后负载均衡失败,LoadBalancer.chooseServer返回null,导致了InvokerUtils的reactiveInvoke方法封装到invocation.next的AsyncResponse被调用:
   `      invocation.next(ar -> {
           ContextUtils.setInvocationContext(invocation.getParentContext());
           try {
             invocation.getInvocationStageTrace().finishHandlersResponse();
             invocation.onFinish(ar);
             asyncResp.handle(ar);
           } finally {
             ContextUtils.removeInvocationContext();
           }
         });`
   
调用导致ContextUtils.removeInvocationContext()语句执行,ContextUtils中的contextMgr被清理,如下业务代码执行触发空指针异常:
   
ContextUtils.getInvocationContext().getLocalContext().put(CommonConstant.RETURN_CODE,0)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@servicecomb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to