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

Saga模式下,分支事务超时问题 #519

Open
1528992118 opened this issue Aug 18, 2024 · 1 comment
Open

Saga模式下,分支事务超时问题 #519

1528992118 opened this issue Aug 18, 2024 · 1 comment

Comments

@1528992118
Copy link

我使用的Dtm Server版本为1.18.0,下面是我注册的本次saga事务信息:

{
	"steps": [{
		"action": "http://localhost:9002/ccfmonitor/internal/v1/saga/test/action",
		"compensate": "http://localhost:9002/ccfmonitor/internal/v1/saga/test/compensate"
	}, {
		"action": "http://localhost:9002/ccfmonitor/internal/v1/saga/test2/action",
		"compensate": "http://localhost:9002/ccfmonitor/internal/v1/saga/test2/compensate"
	}],
	"payloads": ["{\"name\":\"dtm\"}", "{\"name\":\"dtm\"}"],
	"customData": "{\"concurrent\":true,\"orders\":{\"0\":[1]}}",
	"waitResult": false,
	"timeoutToFail": 30,
	"retryInterval": 60,
	"passthroughHeaders": [],
	"branchHeaders": {},
	"gid": "ef6cb7d2-f4e1-4905-ba26-b8c700de0427",
	"transType": "saga",
	"subType": "saga"
}

在使用过程中,主要想看下分支事务在模拟耗时情况下,DTM的处理机制,当我在ccfmonitor/internal/v1/saga/test2/action具体代码中模拟了线程睡眠10秒后,我发现Dtm Server会判定本次action接口有问题,并一直触发重试机制。这里我有个疑问,我不是将全局的超时时间设置为了30秒,为什么Dtm Server还会一直触发重试?

image

@yedf2
Copy link
Contributor

yedf2 commented Sep 28, 2024

接口调用超时是比较短的,不是通过timeoutToFail设置的。接口调用一般不会超过3秒的。一个接口调用超过3秒了,通常意味着设计有问题。

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