Skip to content

Jobs discarded even though attempts remained ? #1165

Open

Description

@Pascal-Delange

I think I just encountered an issue where jobs were discarded and marked at "max_attempts=1" after a service restart.
I just upgraded to v0.31.0 (go 1.26).

I have a job type for which I know for a fact that we only ever enqueue them with the default value of max_attempts (so MaxAttempts=0 in the struct, meaning 25 attempts). I'm also fairly sure that nothing was modified manually.
All those jobs (252 succeeded, 78 discarded) where created at 2026-03-11 17:01:49.393302 +00:00 with a scheduled_at at the same time.
This happened just 2 minutes after a service restart, and about 8 second after an info log about the job rescuer / cleaner run.
I have no indication that my application code created those jobs, so I'm thinking some background job might have done something ?

I'm a bit out of ideas, but I thought I'd ask for an opinion here.

Activity

  1. brandur commented on Mar 12, 2026

    @brandur
    Contributor

    Hey @Pascal-Delange, this doesn't give us too much to work with and I doubt we'll be able to give you much debugging advice.

    Maybe something you could try would be to write a custom hook and put that into your client:

    https://riverqueue.com/docs/hooks#hook-operations

    Then if you detect that a job is being inserted with MaxAttempts == 1 you could flag it and write some debug information.

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

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