Skip to content

Avoid infinite retries for reject_on_worker_lost #9082

Closed

Description

@ShuaiShao93

Checklist

  • I have checked the issues list
    for similar or identical feature requests.
  • I have checked the pull requests list
    for existing proposed implementations of this feature.
  • I have checked the commit log
    to find out if the same feature was already implemented in the
    main branch.
  • I have included all related issues and possible duplicate issues
    in this issue (If there are none, check this box anyway).

Related Issues and Possible Duplicates

Related Issues

Possible Duplicates

  • None

Brief Summary

Enabling reject_on_worker_lost may cause infinite retry because it requeues the task to message broker, and it doesn't honor the max retries. This is extremely risky and may cause significant loss. Is there a way to somehow avoid infinite retries?

Design

Architectural Considerations

None

Proposed Behavior

Add a param like max_requeue?

Proposed UI/UX

Diagrams

N/A

Alternatives

None

Activity

  1. abdullahmujahidali commented on Oct 11, 2026

    @abdullahmujahidali
    Contributor

    Hi, I'd like to work on this it's the same problem as discussion #8969 where @auvipy said

    a draft PR would be welcome

    #9720 fixed the missing request context in task_failure but tasks that hit a lost worker still get requeued with no limit.

    My plan is option A from that discussion made opt-in: add a new setting (something like task_retry_on_worker_lost off by default). When it's on a lost worker goes through retry() instead of reject(requeue=True), so max_retries applies. When it's off, nothing changes.

    I'll open a draft PR for this.

  2. added this to the 5.7.0 milestone on Oct 12, 2026
  3. added a commit that references this issue on Oct 14, 2026
    c09b6ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions