Temporal 常见 F&Q 速查

1、启动 worker 失败

INFO No Lofigured for temporal client. Created default one.

Unable to create client failed reaching server: upstream connect error or disconnect/reset before headers. reset reason: connection failure

解决:没找到链接资源,需检查服务发现相关代码再次重试即可。

2、Failed to poll for task

2023/06/02 11:54:50 WARN  Failed to poll for task. Namespace temporal-eco TaskQueue hello-world WorkerID 3351@z--debug-xujialong01-51150-57f5f4c9bb-n6xjk@ WorkerType WorkflowWorker Error unexpected HTTP status code received from server: 504 (Gateway Timeout); transport: received unexpected content-type "text/html"

Worker Failed to poll for task - #3 by nitesh237 - Community Support - Temporal

翻译下:当在没有可执行的 Workflow 任务的时,Worker 会长轮询超时(Go SDK为70)警告,属于正常日志。

3、工作流数据丢失

Temporal workflow 数据默认保留三天(Namespace 维度),需调整数据保留时限(目前最大支持 30 天)

4、Namespace not found

2023/08/13 15:25:54 INFO  No logger configured for temporal client. Created default one.

2023/08/13 15:25:54 Unable to execute workflow Namespace temporal-namespace is not found.

exit status 1

需注册命名空间(业务资源隔离)

5、定时工作流启动后报 Schedules are disabled

temporal 默认是没有开启 schedule 的,需 enableSchedule

6、定时工作流异常

(1)指定的时间点没有触发

使用姿势不对

  • 参数设置:时区
  • Queue 映射一致(starter、worker)

(2)已经成功执行了但是 temporal 还是显示 running

定时 schedule workflow 需要手动关闭

7、No Workers Running

解决:检查业务 worker 容器状态。可能是容器未启动或容器 hang 住

8、grpc: the client connection is closing

解决:连接失败,请检查获取 temporal client 的代码

 可参考:

9、unable to decode: json: cannot unmarshal number

unable to decode the activity function input payload with error: payload item 1: unable to decode: json: cannot unmarshal number into Go value of type []*workflow.Item for function name: GenerateEachLineDataActivity

解决:Json 大整数反序列化需要指定结果目标类型为指针,否则报 cannot unmarshal number

 可参考:

10、Workflow 失败后支持重试

针对非预期重试失败,解决偶然性问题的,可支持

  • 全流程的重播
  • 某一节点的重试

// Reset workflow execution

_, err = c.ResetWorkflowExecution(context.Background(), &workflowservice.ResetWorkflowExecutionRequest{

    Namespace: "default"// 命名空间

    WorkflowExecution: &commonpb.WorkflowExecution{

        WorkflowId: "hello_world_123",                      // 工作流 ID

        RunId:      "95aec3f8-71b2-4936-9daf-7af722284a15"// 运行 ID

    },

    Reason:                    "reset execution from test"// 重置原因(自定义)

    WorkflowTaskFinishEventId: 10,                          // 完成态事件ID(仅接受 `WORKFLOW_TASK_COMPLETED`,`WORKFLOW_TASK_TIMED_OUT`, `WORKFLOW_TASK_FAILED`, `WORKFLOW_TASK_STARTED` 状态下的事件 ID

})

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值