Skip to content

Conversation

@conan8737
Copy link

This PR implements exponential backoff support for workflows. The core logic follows the same pattern as the existing saga transaction handler, as referenced in issue #572.

@yedf2
Copy link
Contributor

yedf2 commented Jan 3, 2026

@conan8737 there is test failure. Can you fix it?

@conan8737
Copy link
Author

@yedf2 please try again

I can't reproduce this issue because I don't have a local MySQL environment, so I tested it on Redis instead. I suspect it's a problem with this piece of code, so I deleted it.

if err == nil && (time.Since(t.lastTouched)+NowForwardDuration >= 1500*time.Millisecond ||
		t.NextCronInterval > conf.RetryInterval && t.NextCronInterval > t.RetryInterval) {
		t.touchCronTime(cronReset, 0)
}

Because for Workflow, this is the end of the entire transaction (maybe one of the sub-transactions encountered an error), while in Saga, each sub-transaction is processed individually, so I thik this logic is unnecessary for Workflow.

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

Successfully merging this pull request may close these issues.

2 participants