Skip to content

mark in-progress tickets as failed on daemon startup#31

Open
irmorteza wants to merge 1 commit into
Neokil:mainfrom
irmorteza:fix/recover-stuck-tickets
Open

mark in-progress tickets as failed on daemon startup#31
irmorteza wants to merge 1 commit into
Neokil:mainfrom
irmorteza:fix/recover-stuck-tickets

Conversation

@irmorteza
Copy link
Copy Markdown

Summary

  • detect tickets still marked as in-progress, queued, or running
    when the daemon starts up
  • mark those stuck tickets as failed with a clear message:
    "daemon restarted while ticket was running — rerun to continue"
  • mark any associated running/queued jobs as failed as well
  • skip tickets already in a terminal state (done, failed, cancelled)

Testing

  • go test ./...

Notes

  • recoverStuckTickets() is called once at daemon startup, before
    workers begin
  • tickets can be re-run manually after recovery

Open Questions

  • Auto-retry instead of fail? It might be better to automatically
    re-run stuck tickets instead of marking them as failed. However, this
    could cause an infinite loop if a ticket is fundamentally broken —
    the daemon would restart → re-run → crash → restart forever.
    A possible safeguard: add a retry_count field and only auto-retry
    if under a threshold (e.g. 3 attempts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant