Skip to content
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

feat: retry queue items #7649

Merged
merged 4 commits into from
Feb 17, 2025
Merged

feat: retry queue items #7649

merged 4 commits into from
Feb 17, 2025

Conversation

psychedelicious
Copy link
Collaborator

Summary

Add functionality to retry a failed or canceled queue item by copying it. See commits for details.

Related Issues / Discussions

Offline discussion

QA Instructions

Try it out. There's an awkward UX - once a queue item fails or is canceled, you can always retry it. Perhaps this should be disabled when it's been retried a certain number of times?

Merge Plan

n/a

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

Retrying a queue item means cloning it, resetting all execution-related state. Retried queue items reference the item they were retried from by id. This relationship is not enforced by any DB constraints.

- Add `retried_from_item_id` to `session_queue` table in DB in a migration.
- Add `retry_items_by_id` method to session queue service. Accepts a list of queue item IDs and clones them (minus execution state). Returns a list of retried items. Items that are not in a canceled or failed state are skipped.
- Add `retry_items_by_id` HTTP endpoint that maps 1-to-1 to the queue service method.
- Add `queue_items_retried` event, which includes the list of retried items.
- Add the new HTTP endpoint to the queue client
- Add buttons to the queue items to retry them
@github-actions github-actions bot added api python PRs that change python files services PRs that change app services frontend PRs that change frontend files labels Feb 17, 2025
Copy link
Member

@hipsterusername hipsterusername left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we need to prevent the insane from doing their thing.

@psychedelicious psychedelicious merged commit ca50f81 into main Feb 17, 2025
15 checks passed
@psychedelicious psychedelicious deleted the psyche/feat/retry-queue branch February 17, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api frontend PRs that change frontend files python PRs that change python files services PRs that change app services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants