-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: fix the key parameter problem of sofa-rpc setAttachment() method #5745
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么会报错,测试用例测试的时候好像没报错呀,是新的规范吗?
@a364176773 我看 |
/** | ||
* The constant HIDDEN_KEY_BRANCH_TYPE | ||
*/ | ||
public static final String HIDDEN_KEY_BRANCH_TYPE = Constants.HIDE_KEY_PREFIX_CHAR + KEY_BRANCH_TYPE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comment.
RpcInternalContext.getContext().setAttachment(RootContext.KEY_XID, xid); | ||
RpcInternalContext.getContext().setAttachment(RootContext.KEY_BRANCH_TYPE, branchType.name()); | ||
RpcInternalContext.getContext().setAttachment(RootContext.HIDDEN_KEY_XID, xid); | ||
RpcInternalContext.getContext().setAttachment(RootContext.HIDDEN_KEY_BRANCH_TYPE, branchType.name()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some case to prove RpcInternalContext.getContext().setAttachment(RootContext.KEY_XID, xid);
not as expected ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test case added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 补充下changelog
@a364176773 已补充 |
develop 也需要同步一个pr |
OK,我同步一下 |
Ⅰ. Describe what this PR did
在
sofa-rpc
中,RpcInternalContext.getContext().setAttachment()
方法的key
参数要求以.
或者_
开头,否则会抛异常Ⅱ. Does this pull request fix one issue?
fix #3835
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews