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 2018/12/05 01:50:08 UTC

[GitHub] jeho0815 commented on a change in pull request #1022: [SCB-1065] when request not contain traceId, should use provider's invocation's traceId

jeho0815 commented on a change in pull request #1022: [SCB-1065] when request not contain traceId,should use provider's invocation's traceId
URL: https://github.com/apache/servicecomb-java-chassis/pull/1022#discussion_r238906399
 
 

 ##########
 File path: swagger/swagger-invocation/invocation-core/src/main/java/org/apache/servicecomb/swagger/invocation/context/InvocationContext.java
 ##########
 @@ -68,6 +68,22 @@ public void addContext(Map<String, String> otherContext) {
     context.putAll(otherContext);
   }
 
+  public void mergeContext(InvocationContext otherContext) {
+    mergeContext(otherContext.getContext());
+  }
+
+  public void mergeContext(Map<String, String> otherContext) {
+    if (otherContext == null) {
+      return;
+    }
+    if (otherContext.size() > context.size()) {
+      otherContext.putAll(context);
 
 Review comment:
   > 1.loop context and otherContext.putIfAbsent
   > 2.still did not process highway transport?
   
   new traceid created in invocation.onStart, then merge context. if only merge absent keys, the traceid is the new one.
   can we put the merge context before invocation.onStart?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services