You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2022/09/06 12:47:11 UTC

[GitHub] [servicecomb-java-chassis] Rainlone opened a new issue, #3323: addLocalContext(parentContext.getLocalContext());多线程问题Concurrentmodificationexception Bug

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

   这个类有构造这个代码:
   org.apache.servicecomb.swagger.invocation.SwaggerInvocation#SwaggerInvocation
     public SwaggerInvocation() {
       parentContext = ContextUtils.getInvocationContext();
       if (parentContext != null) {
         addContext(parentContext.getContext());
         addLocalContext(parentContext.getLocalContext());
       }
     }
   
   其中addLocalContext(parentContext.getLocalContext()); 里面调用了localContext.putAll(otherContext);
   这个在多线程环境,业务代码自己开多线程调用下游服务传递上下文会有多线程问题,报Concurrentmodificationexception异常
   建议使用public void setLocalContext(Map<String, Object> localContext)直接设置上下文


-- 
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-unsubscribe@servicecomb.apache.org.apache.org

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


[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #3323: addLocalContext(parentContext.getLocalContext());多线程问题Concurrentmodificationexception Bug

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #3323:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3323#issuecomment-1238826692

   InvocationContext是线程上下文,你能具体描述下问题发生场景或者提供下错误堆栈吗?


-- 
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-unsubscribe@servicecomb.apache.org

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