Automattic / Automattic/kue

redis leftover keys

Open
#1,192 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

While making sure jobs get finished successfully and being removed, i still see some leftovers in my redis.. After processing one job successfully, i have this on redis:

```
1) "q:job:1:log"
2) "q:job:1"
3) "q:ids"
4) "q:stats:work-time"
6) "q:job:types"
```

the 1) and 2) keys seem like lefrovers of the finished job.. after another job more of those are added.. i do remove jobs successfully because otherwise without removing i also see this key -
`q:jobs:runNewJob:complete`

Here's my usage code:

```
queue.create('runNewJob', {id, anotherId})
.ttl(SOME_TTL)
.priority('high')
.removeOnComplete(true)
.on('complete', (result) => {
// some code and logs..
})
.on('failed', (err) => {
// Some logs and code..
})
.save();
```

Maybe those leftovers are supposed to stay there?
Cuz after sometime they inflated to over 1 million useless keys!

Thanks a lot!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported behavior with the shown queue.create(...).removeOnComplete(true) usage and inspect the listed Redis keys after a job completes. Trace how completed jobs are removed and determine whether q:job:1, q:job:1:log, and the other reported keys are expected; done means explaining or correcting the unbounded key growth.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, redis
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.