-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate Task Execution in Hatchet Worker on Timeout #1022
Comments
Hi @gustavobittencourt thanks for the detailed report you seem to be 12 minor versions behind the latest sdk, v0.38.3 is the latest stable release. Would you be able to try upgrading and report back if you're seeing the same behavior. Also, are you running on Hatchet Cloud or Self Hosted? If Self Hosted, what version are you running? |
Hi @grutt, thanks for your response! I just upgraded the [tool.poetry]
name = "src"
version = "0.0.0"
description = "Easily run background tasks in Python with Hatchet"
authors = []
readme = "README.md"
[tool.poetry.scripts]
hatchet = "src.main:start"
[tool.poetry.dependencies]
python = "^3.10"
hatchet-sdk = "^0.38.3"
python-dotenv = "^1.0.1"
openai = "^1.54.2"
beautifulsoup4 = "^4.12.3"
requests = "^2.32.3"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api" I am running Hatchet locally based on the I verified the Hatchet component versions running in the containers: /hatchet # ./hatchet-engine --version
v0.50.4 /hatchet # ./hatchet-api --version
v0.50.4 However, even after the upgrade, the issue with duplicate task executions persists. The logs still show duplicate executions of steps, as illustrated in the example log snippet below, which shows the behavior observed after a timeout:
Here is the workflow run screenshot on Hatchet dashboard: Please let me know if there are any additional recommendations or configurations to adjust. Thank you! |
Description:
I am experiencing duplicate task executions in my Hatchet worker whenever a timeout occurs on a task. As part of my testing, I intentionally set low timeouts for tasks in my workflow to observe how Hatchet handles retries. However, I’ve observed that each timeout leads to duplicate executions, even after the task has moved on to the next step or completed successfully.
Expected Behavior:
When a task times out and a retry is triggered, only the new attempt should execute. Any previous instance of the timed-out task should be canceled to prevent duplicate runs.
Actual Behavior:
When a timeout occurs, Hatchet retries the task as expected, but the worker ends up running duplicate instances of the same step. Below is an example from my logs showing timestamps that illustrate duplicate executions:
Example Logs:
In this example:
17:42:05
but then appears to run again, finishing at17:42:11
.Worker Code for Reproduction:
Configuration Details:
0.26.0
3.12.7
13.6.7 (22G720)
Steps to Reproduce:
Questions:
Any insights or guidance on how to resolve this would be greatly appreciated! Thank you for your help.
The text was updated successfully, but these errors were encountered: