-
Notifications
You must be signed in to change notification settings - Fork 8
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
[🐛 BUG]: Worker after SIGTERM not wait for finish activity #276
Comments
Hey @cv65kr 👋🏻
The worker does wait for the workflow. To set the But, worker can't wait for an indefinite timeout. This functionality exists in any SDK. For the given Java SDK (shutdown):
If you want to wait a bigger amount of time, just pass |
SIGKILL kills the process, not the workflow. After the restart, the workflow will be restarted. Even if you kill the temporal server, the history journal will be present in DB and will be recovered. |
This is the reason, why the activity started only once. |
Hi @rustatian I already checked the
Yes, that's my point but ofc is dependent of various factors e.g. if activity was in the middle of the processing then it cannot be recovered after restart.
I just give you a code to reproduce, and that's the case sometimes activity cannot be reattempted. And need to be safe during redeployments. I will close topic for now, and if something pop up I will reopen it. Once again big thanks! |
No duplicates 🥲.
What happened?
Workflow
Acitivity:
Let's imagine situation when one of activity is responsible for sending POST request (this request can be send only one time) and it takes around 30 seconds.
In the 15th second while sending request, one of developer made a deployment - so he send a SIGTERM to kill container.
In logs after sent SIGTERM I see
Activity was interrupted and is not processed anymore so in result in Temporal I see
From my perspective worker should wait for finish this activity as a secure way. Only SIGKILL should immediately kill process.
Functionality available in java-sdk - https://www.javadoc.io/static/io.temporal/temporal-sdk/1.0.0/io/temporal/worker/WorkerFactory.html#awaitTermination-long-java.util.concurrent.TimeUnit-
Or maybe I am doing something wrong.
Version
v2.11.3
Relevant log output
No response
The text was updated successfully, but these errors were encountered: