Skip to content
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

seata服务在调用了有20秒超时的扣除余额的微服务后,依然扣除了余额 #8

Open
zyzTm opened this issue Jan 21, 2021 · 1 comment

Comments

@zyzTm
Copy link

zyzTm commented Jan 21, 2021

老师,您好,关于您的课程 (https://www.bilibili.com/video/BV18E411x7eT?p=147) 第147节里面的内容,我按视频里敲了一遍后,发现一个问题,我以为我敲漏了,然后下载您的源代码运行后,还是有这个问题:
当用了@GlobalTransactional(name = "fsp-create-order",rollbackFor = Exception.class) 后,在调用扣除余额的微服务时,用了【//暂停几秒钟线程 try { TimeUnit.SECONDS.sleep(20); } catch (InterruptedException e) { e.printStackTrace(); } 】后,订单表确实没有新订单创建、库存表确实没有扣减库存;但是账户表,刚开始是没有扣减余额,但过了20秒后,余额扣减了。
也就是从1订单-->到2库存-->到3扣余额,前二步都回滚了,但第3步的微服务,自己等待自己的超时时间完成后,依然执行了自己的流程。
请问如何解决这类问题?
snipaste_20210121_232746

@UnityAlvin
Copy link

UnityAlvin commented Apr 13, 2021

我还以为就我这样呢,我的是只有订单受控制,库存跟账户都会减少(泪奔),兄弟,你解决了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants