【问题标题】:reset failed (code:deadline-exceeded message:timeout)重置失败(代码:deadline-exceeded message:timeout)
【发布时间】:2026-02-11 22:10:01
【问题描述】:

我们可以使用 Cadence cli 从系统中读取数据(例如列出工作流、列出给定工作流的历史记录等)。

但是,在尝试重置工作流程时,我们会收到超时错误。我们尝试手动增加超时时间(通过--context_timeout 标志),但这似乎没有帮助。

我们检查了工作流程的历史记录,似乎相关工作流程没有发生任何事情(即没有开始新的运行或类似的事情)。

./cli.sh --context_timeout 240 --domain ourdomain workflow reset -w 15a3839e-d1b6-41f5-ac50-fd262f0f4bfb -r 17551fe8-ce21-4272-8101-8f9bccc614c9 --reset_type LastDecisionCompleted --reason "Retrying due to a failed activity"

Error: reset failed
Error Details: code:deadline-exceeded message:timeout
Stack trace:
goroutine 1 [running]:
runtime/debug.Stack(0xd, 0x0, 0x0)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x9d
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x22
github.com/uber/cadence/tools/cli.printError(0x1f70b43, 0xc, 0x23f24c0, 0xc000762180)
        /cadence/tools/cli/util.go:536 +0x2ad
github.com/uber/cadence/tools/cli.ErrorAndExit(0x1f70b43, 0xc, 0x23f24c0, 0xc000762180)
        /cadence/tools/cli/util.go:547 +0x49
github.com/uber/cadence/tools/cli.ResetWorkflow(0xc000410f20)
        /cadence/tools/cli/workflowCommands.go:1545 +0x6b8
github.com/uber/cadence/tools/cli.newWorkflowCommands.func20(0xc000410f20)
        /cadence/tools/cli/workflow.go:251 +0x2b
github.com/urfave/cli.HandleAction(0x1b702c0, 0x2027280, 0xc000410f20, 0xc000410f20, 0x0)
        /go/pkg/mod/github.com/urfave/cli@v1.22.4/app.go:528 +0x127
github.com/urfave/cli.Command.Run(0x1f663bc, 0x5, 0x0, 0x0, 0xc0000817a0, 0x1, 0x1, 0x1fc5c3b, 0x33, 0x0, ...)
        /go/pkg/mod/github.com/urfave/cli@v1.22.4/command.go:174 +0x528
github.com/urfave/cli.(*App).RunAsSubcommand(0xc0002d2a80, 0xc000410c60, 0x0, 0x0)
        /go/pkg/mod/github.com/urfave/cli@v1.22.4/app.go:407 +0x882
github.com/urfave/cli.Command.startApp(0x1f6b11a, 0x8, 0x0, 0x0, 0xc000081b20, 0x1, 0x1, 0x1f88e40, 0x18, 0x0, ...)
        /go/pkg/mod/github.com/urfave/cli@v1.22.4/command.go:373 +0x845
github.com/urfave/cli.Command.Run(0x1f6b11a, 0x8, 0x0, 0x0, 0xc000081b20, 0x1, 0x1, 0x1f88e40, 0x18, 0x0, ...)
        /go/pkg/mod/github.com/urfave/cli@v1.22.4/command.go:102 +0x9d6
github.com/urfave/cli.(*App).Run(0xc000350000, 0xc0000d6000, 0xf, 0xf, 0x0, 0x0)
        /go/pkg/mod/github.com/urfave/cli@v1.22.4/app.go:279 +0x731
main.main()
        /cadence/cmd/tools/cli/main.go:36 +0x4f

我们也尝试过使用--event_id 代替--reset_type,并且我们尝试过对不同的工作流ID 进行操作,但我们仍然遇到同样的超时错误。

我们是否错误地使用了 cli?

【问题讨论】:

    标签: cadence-workflow uber-cadence


    【解决方案1】:

    如果当前有一个打开的运行,您可能会遇到重置工作流的错误。

    https://github.com/uber/cadence/pull/3727

    在 0.15.x 中引入了该错误。它目前已在 master 中修复,我们正在努力在 0.16.0 中发布

    作为一种解决方法,您可以终止当前打开的工作流运行,然后重置它,然后重置关闭的工作流应该可以工作。

    如果您要重置基于的 runID 已关闭,则该错误仍然存​​在,只要相同的 workflowID 有一个打开的 runID。因为错误中的问题是终止当前运行时出现问题。但是重置需要终止当前的一个,以便它可以启动一个新的。

    您可以通过以下方式找到当前打开的runID:

    ./cadence --domain ourdomain workflow describe -w 15a3839e-d1b6-41f5-ac50-fd262f0f4bfb
    

    如果没有 runID,如果它正在运行/打开,这将返回当前的 runID。

    【讨论】:

    • 啊,抱歉,我应该提到:相关工作流程已关闭。我们试图重置它的原因是因为我们想在一些代码更改后“重试”它。它在某个特定的活动上死了,我们希望它在那个故障点再次运行。
    • 你能在cadence-server上找到错误日志看看为什么请求超时吗?
    • 更新了我的答案。我应该更清楚地说明它不是关于 baseRunID,而是关于您正在重置的工作流的当前 runID。