File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/protocol Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -134,16 +134,15 @@ public Result invoke(Invocation inv) throws RpcException {
134134 if (attachment != null && attachment .size () > 0 ) {
135135 invocation .addAttachmentsIfAbsent (attachment );
136136 }
137- Map <String , String > context = RpcContext .getContext ().getAttachments ();
138- if (context != null ) {
137+ Map <String , String > contextAttachments = RpcContext .getContext ().getAttachments ();
138+ if (contextAttachments != null ) {
139139 /**
140140 * invocation.addAttachmentsIfAbsent(context){@link RpcInvocation#addAttachmentsIfAbsent(Map)}should not be used here,
141141 * because the {@link RpcContext#setAttachment(String, String)} is passed in the Filter when the call is triggered
142142 * by the built-in retry mechanism of the Dubbo. The attachment to update RpcContext will no longer work, which is
143143 * a mistake in most cases (for example, through Filter to RpcContext output traceId and spanId and other information).
144- * yizhenqiang 20180310
145144 */
146- invocation .addAttachments (context );
145+ invocation .addAttachments (contextAttachments );
147146 }
148147 if (getUrl ().getMethodParameter (invocation .getMethodName (), Constants .ASYNC_KEY , false )) {
149148 invocation .setAttachment (Constants .ASYNC_KEY , Boolean .TRUE .toString ());
You can’t perform that action at this time.
0 commit comments