Strange attempts and backoff Behavior
- Dominant language
- JavaScript
- Stars
- 9.4k
- Forks
- 858
- PR merge metrics
- No merged PRs in 30d
Description
After months in production I see a strange behavior of `attempts` and `backoff`.
This is my code where I create the jobs using `attempts` and `backoff`.
``` js
queue.create('message_outgoing', data)
.attempts(3)
.backoff({type: 'exponential'})
.removeOnComplete(true)
.save(function(error){
if(error) {
return done(error)
}
done()
})
```
And this is the some jobs in `active` state with strange value of attempts.

Also this is the `attempts` value inside one of the job object.
``` js
"attempts": {
"made": 65,
"remaining": -62,
"max": 3
}
```
Why the attempts made more than the maximum value?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the behavior with the JavaScript queue snippet and the reported attempts object, then trace how attempts and exponential backoff are updated for active jobs. Done means identifying why made exceeds max and either confirming the intended behavior or correcting it with a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100