首页 > 解决方案 > 重置失败(代码:deadline-exceeded message:timeout)

问题描述

我们可以使用 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-workflowuber-cadence

解决方案


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

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。


推荐阅读