-
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: in dubbo 3.x version, the consumer can't generate tcc proxy. #6101
Changes from 20 commits
ef782b3
1df81eb
8e92325
7482281
522c386
0444780
881aaf4
b8f822c
fc2e79f
e36326e
0bf3847
47d150d
12f8109
c8a6115
c5761c7
572192b
53f3070
2a01c04
6513a35
184e05a
27f1db4
61df543
5efb325
988bb7a
056c3f0
60b4adf
a6af930
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ private DubboUtil() { | |
private static final String ALIBABA_DUBBO_PROXY_NAME_PREFIX = "com.alibaba.dubbo.common.bytecode.proxy"; | ||
private static final String APACHE_DUBBO_PROXY_NAME_PREFIX = "org.apache.dubbo.common.bytecode.proxy"; | ||
|
||
private static final String DUBBO_3_X_PARTIAL_PROXY_NAME = "DubboProxy"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you only use contains? and not startsWith or endsWith? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deeply analyzing the source code is really excellent. |
||
|
||
/** | ||
* get the interface class of the dubbo proxy which be generated by javaassist | ||
* | ||
|
@@ -69,6 +71,6 @@ public static Class<?> getAssistInterface(Object proxyBean) | |
} | ||
|
||
public static boolean isDubboProxyName(String name) { | ||
return name.startsWith(ALIBABA_DUBBO_PROXY_NAME_PREFIX) || name.startsWith(APACHE_DUBBO_PROXY_NAME_PREFIX); | ||
return name.startsWith(ALIBABA_DUBBO_PROXY_NAME_PREFIX) || name.startsWith(APACHE_DUBBO_PROXY_NAME_PREFIX) || name.contains(DUBBO_3_X_PARTIAL_PROXY_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.
为什么要改变入参,而不是在由调用方决定是否开启tryOtherApp
Why change the entry parameter when it's up to the caller to turn on tryOtherApp?
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.
i feel the place convention over configuration is better, method signature is better understood without loss of flexibility.
这个地方感觉用 预定大于配置 的方法更好一点,不失灵活性的同时方法签名也更好理解.
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.
I'm not sure if there are any other branch types that need this in the future, but if they all rely on an internal if || it's just too low.
未来不确定有没有其他的分支类型需要这种,如果都靠内部一个if || 这种写法太low了
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.
What about tryOtherApp in AT transaction mode? The original logic is that only AT mode can go here, now only TCC mode can go here?
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.
yeah, because of TCC rpc mode regiter branch in constomer, send order of TC two stage to provider. so it can't find the channel as normal, so tcc model will try other app. @funky-eyes 's opinion there may be a risk in at to find a same resource diff app channel, ex: two instance have status.
是的,因为TCC RPC模式是在消费者端注册分支,TC在二阶段下发指令给服务者端。导致通过消费者端的app去找服务者端的channel的时候会失败,所以tcc 模式会尝试其他app channel. @funky-eyes 的建议在AT模式下发指令到相同资源不同app的端可能存在风险, 比如两台实例可能有状态的情况下.
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.
no problem, i will rollback.
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.
Maybe this is not the scope of this bugfix.
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.
tcc rpc mode can't find the channel, if no this change.