Skip to content

Custom validity periods or record past failed task stack trace/reasons #2827

Closed
@dzmm

Description

@dzmm

Is your feature request related to a problem? Please describe.

Currently, BullMQ lacks flexible control over task validity periods, especially for HTTP request-type tasks. For instance, with certain HTTP request tasks, retrying after 30 seconds of no response often becomes meaningless. We need the ability to set shorter validity periods (e.g., 20 seconds) for such tasks, after which retries should cease.
Moreover, our current approach marks timed-out tasks as failed, but this overwrites the original error information, preventing us from tracking the root cause of task failures.

Describe the solution you'd like
Allow setting custom validity periods for individual tasks or task types.
Enable normal retry mechanisms within the validity period.
Automatically stop retrying after the validity period expires, while preserving the original error information.
Provide a mechanism to track historical error information for tasks, including errors generated during intermediate retry attempts.

Additional context
This feature is particularly crucial for handling time-sensitive tasks (e.g., real-time communication, payment processing). It would help us better manage system resources by avoiding wasted time and computational power on tasks that have lost relevance. Additionally, maintaining complete error histories would significantly enhance our debugging and problem diagnosis capabilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions