-
Notifications
You must be signed in to change notification settings - Fork 723
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
拒绝策略为CallerRunsPolicy时,MdcRunnable会删除主线程mdc信息【bug】 #330
Comments
感谢反馈,是个问题,有兴趣可以提个pr修复下 |
可以的, 不过我也很奇怪traceId没丢, 这块是为啥? 不过我想应该不用把mdc的其他属性和traceId分开处理吧, 这块能讲下设计思路么 |
traceId没丢是因为在mdcRunnable#run执行后没有remove traceId信息。之所以这样设计是因为afterExecute方法里做执行超时告警时需要traceId,其他mdc相关信息用不到,所以其他mdc信息在退出mdcRunnable#run方法时需要清理掉,traceId信息需要在afterExecute执行后在单独清理。 |
好的, 想到了, afterExecute如果走到拒绝策略就不调这方法了, 那基于这点是否需要把afterExecute的处理逻辑要提到run里呢 |
走了拒绝策略的就先不考虑这些了,afterExecute的处理又依赖beforeExecute的逻辑,比较复杂。先就处理走了拒绝策略不要清除掉主线程的mdc信息就行。 |
好的 |
@yanhom1314 MdcRunnable中我们只要清理parentMdc即可?因为parentMdc是我们构造函数设置的,所以我们清理也是应当;但MDC中的数据有可能是主线程设置的,那这个时候clean是否是主线程行为决定 |
现在是只会清理parentMdc中的kv,其他mdc字段不清理的,没问题的。 |
好像现在MdcRunnable中通过MDC.remove移除MDC的kv |
pr的话基于master拉分支么 |
是的,不过此issue有同学解决并且合并了(gitee那边) |
首先感谢您使用 DynamicTp,如果使用过程中有任何问题,请按照下述模板反馈问题,建议使用 Markdown 语法。
版本信息
问题描述
文字描述、截图、粘代码方式
复现步骤
其他信息
The text was updated successfully, but these errors were encountered: