[Bug] moneybatcher sample race condition?
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- java
调研方向
从 core/src/main/java/io/temporal/samples/moneybatch 下的 moneybatch sample 开始,并从链接的复现分支运行 TransferWorkflowTest。检查 Workflow.await 条件,以及针对超过一个 batch 大小的请求的测试设置。完成标准是复现的 workflow 能够完成并处理预期的 batches,而不是一直处于阻塞状态。
由索引模型根据 Issue 内容生成。
描述
What are you really trying to do?
I am trying to learn how to do batching using temporal. I found the moneybatch sample and I wanted to make sure that it can handle requests in parallel.
To simulate the behavior, I changed the workflow to withdraw more times than a single batch size as well as added a delay during the deposit call.
What this lead to is that the workflow would continue to run and not complete, it won't even process a single batch.
Describe the bug
This is related to the condition in the workflow:
Workflow.await(() -> count == batchSize);
If count suddenly goes from 0 to a value greater than batchSize, the workflow will continue to run and not complete.
I am new to temporal, so I am not quite sure how to fix this. Is this a bug in the sample or am I doing something wrong?
Minimal Reproduction
Download this branch:
https://github.com/derwasp/samples-java/tree/derwasp/moneybatcher
Either run ./run-moneybatch-demo.sh and observe the logs.
Or run the test TransferWorkflowTest and see the failure.
Environment/Versions
- OS and processor: M4 Mac
- Temporal Version: (CLI version 1.4.1)
- Are you using Docker or Kubernetes or building Temporal from source? Docker
Additional context
- 主要语言
- Java
- 星标
- 262
- 派生
- 192
- 平均合并
- 3 天 5 小时
- 30 天内合并 PR
- 4
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
temporalio/samples-java 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
temporalio/samples-java#770 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 35/100
temporalio/samples-java#687 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 35/100
temporalio/samples-java#635 · 1 条评论 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 35/100
temporalio/samples-java#606 · 4 个 reaction ·
-
enhancement
难度 3/5 1-2 天 新手友好度 48/100
temporalio/samples-java#597 ·
查看 temporalio/samples-java 的全部 Issue
相似的 Issue
-
[Bug] The shared instance selector's placeholder and no-match text ignore the display language可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 90/100
apache/rocketmq-dashboard#5561 ·
维护者通常 3 天内回复
-
bug good first issue help wanted priority medium size S
难度 2/5 1-3 小时 新手友好度 84/100
martin-francois/symphony-trello#776 · 1 条评论 ·
维护者通常 1 天内回复
-
Console.printHex未关闭good first issue kernel
难度 2/5 1-3 小时 新手友好度 88/100
JackFurton/who-would-build-a-kernel-in-java#33 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
flutter/flutter-intellij#9137 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复