[GH-ISSUE #227] [QUESTION] Is it possible to restart servers or workers when shutdown or killed or exited due to some error? #1099

Closed
opened 2026-03-07 22:05:39 +03:00 by kerem · 1 comment
Owner

Originally created by @sujit-baniya on GitHub (Jan 15, 2021).
Original GitHub issue: https://github.com/hibiken/asynq/issues/227

Originally assigned to: @hibiken on GitHub.

It's possible that when servers or workers doing their work, it's possible that they are down unintentionally (Killed or Exited).
Can we automatically start such servers or workers and start consuming from where it left?

Originally created by @sujit-baniya on GitHub (Jan 15, 2021). Original GitHub issue: https://github.com/hibiken/asynq/issues/227 Originally assigned to: @hibiken on GitHub. It's possible that when servers or workers doing their work, it's possible that they are down unintentionally (Killed or Exited). Can we automatically start such servers or workers and start consuming from where it left?
kerem 2026-03-07 22:05:39 +03:00
Author
Owner

@hibiken commented on GitHub (Jan 17, 2021):

If a process gets killed forcefully (e.g. kill -9), the tasks will be processed again (i.e. retried) when you restart the process.
That's why your Handler.ProcessTask need to be idempotent` because Asynq server will retry any failed tasks.
It's your Handler's job to skip some operations if you want logic such that it'll resume from where it left off.

<!-- gh-comment-id:761855540 --> @hibiken commented on GitHub (Jan 17, 2021): If a process gets killed forcefully (e.g. `kill -9`), the tasks will be processed again (i.e. retried) when you restart the process. That's why your `Handler.ProcessTask` need to be **idempotent`** because Asynq server will retry any failed tasks. It's your Handler's job to skip some operations if you want logic such that it'll resume from where it left off.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynq#1099
No description provided.