当前位置:网站首页>Failure to deliver XID in Seata distributed transaction project
Failure to deliver XID in Seata distributed transaction project
2022-04-23 06:09:00 【commonBean】
Recently seata Encountered in the project xid Unable to get feign Transfer to other micro Services . I found information on the Internet solve seata stay Fegin Open fuse (Hystrix) Transactions cannot be passed between microservices XID Problems and non delivery oauth2 token Problem compatibility Zipkin, Because the article doesn't mention the most important place , So I haven't found the problem yet .
So interrupt point tracking , See that the current service has xid Of , But by feign Invocation time ,xid It's gone , It's weird . Restart the service again and debug, Still the same . I've been tossing around for a long time without making progress . I think of , Since the current service has xid, after feign It's gone when , So is the middle After the destruction steps ? So in RootContext Inside , to unbind Method to hit a breakpoint , And then something magical happened : After the current service, there are xid,SeataFeignClient There is no xid After the steps ,unbind See again xid 了 .
The magic lies in , Why? unbind The step is to feign What happens after the call ? Since it was untied later , that feign Why is there no such thing in xid Well ? I think there is only one explanation : Get twice xid Not in the same context .
So I told the big guys around me , At this time, he finally gave the answer to the question :hystrix There are two service isolation modes : Thread pool isolation and semaphore isolation , Thread pool isolation is used by default . This leads to the call feign Different threads are used , So we can't get the in the previous thread xid. That's easy , take hystrix Change the service isolation mode to semaphore isolation . Call again , Finally got it .
So far, the matter has come to an end .
Think about something else you can learn from .
For example, I found feign Can't get xid, It still took a lot of time to debug, To track , But still nothing . In fact, from here, we can basically conclude that , This road won't work , We should change our thinking . And I spent a lot of time getting nothing , I suddenly thought of other ways . This is an unconscious , A very passive process , Resulting in inefficiency . So I got an experience —— That the road is blocked , Change your mind now .
Another lesson is , Have rich knowledge accumulation . I found unbind You can see xid, In fact, we are very close to finding the answer , It's like digging a well , Dig a few more shovels and you'll get out of the water . But I don't know yet Hystrix Thread pool and semaphore are two isolation modes , So it's a little different from the truth .
All in all , The above is an interesting process . Therefore, there is this article. .
版权声明
本文为[commonBean]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220533053057.html
边栏推荐
- Remedy after postfix becomes a spam transit station
- Create enterprise mailbox account command
- Why does the subscript of the array start from 0 instead of 1?
- Pyqy5 learning (III): qlineedit + qtextedit
- Gaussian processes of sklearn
- Anaconda installed pyqt5 and pyqt5 tools without designer Exe problem solving
- Programming record - picture rotation function SciPy ndimage. Simple use and effect observation of rotate()
- MySQL basic madness theory
- sklearn之 Gaussian Processes
- Graphic numpy array matrix
猜你喜欢
对比学习论文——[MoCo,CVPR2020]Momentum Contrast for Unsupervised Visual Representation Learning
Complete example demonstration of creating table to page - joint table query
Linear algebra Chapter 1 - determinant
Pyqy5 learning (2): qmainwindow + QWidget + qlabel
Comparative study paper - [Moco, cvpr2020] momentum contract for unsupervised visual representation learning
In depth understanding of the relationship between dncblevel and noise denoising in the paper
Practical operation - Nacos installation and configuration
Graphic numpy array matrix
Fundamentals of digital image processing (Gonzalez) II: gray transformation and spatial filtering
Anaconda installed pyqt5 and pyqt5 tools without designer Exe problem solving
随机推荐
Fundamentals of digital image processing (Gonzalez) II: gray transformation and spatial filtering
2. Average length of words
The problem that the page will refresh automatically after clicking the submit button on the form is solved
Protected (members modified by protected are visible to this package and its subclasses)
Anaconda
Pytorch learning record (V): back propagation + gradient based optimizer (SGD, adagrad, rmsporp, Adam)
Font shape `OMX/cmex/m/n‘ in size <10.53937> not available (Font) size <10.95> substituted.
常用编程记录——parser = argparse.ArgumentParser()
Pytorch learning record (XI): data enhancement, torchvision Explanation of various functions of transforms
Pyqy5 learning (2): qmainwindow + QWidget + qlabel
7.Domino piling
数字图像处理基础(冈萨雷斯)一
线性代数第三章-矩阵的初等变换与线性方程组
Pyqy5 learning (III): qlineedit + qtextedit
Pytorch学习记录(五):反向传播+基于梯度的优化器(SGD,Adagrad,RMSporp,Adam)
Why does the subscript of the array start from 0 instead of 1?
You cannot access this shared folder because your organization's security policy prevents unauthenticated guests from accessing it
线代第四章-向量组的线性相关
5.The Simple Problem
Reading of denoising paper - [ridnet, iccv19] real image denoising with feature attention